Class DefaultFormGenerator

java.lang.Object
io.micronaut.views.fields.DefaultFormGenerator
All Implemented Interfaces:
FormGenerator

@Internal @Singleton public class DefaultFormGenerator extends Object implements FormGenerator
DefaultImplementation of FormGenerator.
Since:
4.1.0
Author:
Sergio del Amo
  • Constructor Details

    • DefaultFormGenerator

      public DefaultFormGenerator(FieldsetGenerator fieldsetGenerator)
      Parameters:
      fieldsetGenerator - Fieldset Generator
  • Method Details

    • generateWithFieldset

      public Form generateWithFieldset(@NonNull @NonNull String action, @NonNull @NonNull String method, @NonNull @NonNull Fieldset fieldset, @NonNull @NonNull InputSubmitFormElement inputSubmitFormElement)
      Description copied from interface: FormGenerator
      Generate FORM with fieldset.
      Specified by:
      generateWithFieldset in interface FormGenerator
      Parameters:
      action - Form action attribute
      method - Form method attribute
      fieldset - Fieldset
      inputSubmitFormElement - input submit
      Returns:
      A Form
    • generate

      public Form generate(String action, String method, Object instance, InputSubmitFormElement inputSubmitFormElement)
      Specified by:
      generate in interface FormGenerator
      Parameters:
      action - Form action attribute
      method - Form method attribute
      instance - The Object instance which should be Introspected.
      inputSubmitFormElement - input submit
      Returns:
      A Form
    • generate

      public Form generate(@NonNull @NonNull String action, @NonNull @NonNull String method, @NonNull @NonNull Object instance, @NonNull @NonNull jakarta.validation.ConstraintViolationException ex, @NonNull @NonNull InputSubmitFormElement inputSubmitFormElement)
      Specified by:
      generate in interface FormGenerator
      Parameters:
      action - Form action attribute
      method - Form method attribute
      instance - The Object instance which should be Introspected.
      ex - A Validation exception
      inputSubmitFormElement - input submit
      Returns:
      A Form
    • generate

      public <T> Form generate(@NonNull @NotBlank @NonNull @NotBlank String action, @NonNull @NotBlank @NonNull @NotBlank String method, @NonNull @NotNull @NonNull @NotNull Class<T> type, @NonNull @NotNull @NonNull @NotNull InputSubmitFormElement inputSubmitFormElement)
      Specified by:
      generate in interface FormGenerator
      Type Parameters:
      T - type
      Parameters:
      action - Form action attribute
      method - Form method attribute
      type - A class which should be Introspected.
      inputSubmitFormElement - input submit
      Returns:
      A Form