Package play.data

Class FormFactory


  • @Singleton
    public class FormFactory
    extends Object
    Helper to create HTML forms.
    • Constructor Detail

      • FormFactory

        @Inject
        public FormFactory​(MessagesApi messagesApi,
                           Formatters formatters,
                           javax.validation.ValidatorFactory validatorFactory,
                           com.typesafe.config.Config config)
    • Method Detail

      • form

        public DynamicForm form()
        Returns:
        a dynamic form.
      • form

        public <T> Form<T> form​(Class<T> clazz)
        Type Parameters:
        T - the type of value in the form.
        Parameters:
        clazz - the class to map to a form.
        Returns:
        a new form that wraps the specified class.
      • form

        public <T> Form<T> form​(String name,
                                Class<T> clazz)
        Type Parameters:
        T - the type of value in the form.
        Parameters:
        name - the form's name.
        clazz - the class to map to a form.
        Returns:
        a new form that wraps the specified class.
      • form

        public <T> Form<T> form​(String name,
                                Class<T> clazz,
                                Class<?>... groups)
        Type Parameters:
        T - the type of value in the form.
        Parameters:
        name - the form's name
        clazz - the class to map to a form.
        groups - the classes of groups.
        Returns:
        a new form that wraps the specified class.
      • form

        public <T> Form<T> form​(Class<T> clazz,
                                Class<?>... groups)
        Type Parameters:
        T - the type of value in the form.
        Parameters:
        clazz - the class to map to a form.
        groups - the classes of groups.
        Returns:
        a new form that wraps the specified class.