Package play.data

Class FormFactory

java.lang.Object
play.data.FormFactory

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

    • FormFactory

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

    • 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.