Package io.micronaut.views.fields
Class DefaultFieldGenerator
java.lang.Object
io.micronaut.views.fields.DefaultFieldGenerator
- All Implemented Interfaces:
FieldsetGenerator
Default implementation of
FieldsetGenerator
which relies on the types being introspected.- Since:
- 4.1.0
- Author:
- Sergio del Amo
-
Constructor Summary
ConstructorDescriptionDefaultFieldGenerator
(EnumOptionFetcher<?> enumOptionFetcher, EnumRadioFetcher<?> enumRadioFetcher, EnumCheckboxFetcher<?> enumCheckboxFetcher, io.micronaut.context.BeanContext beanContext, FormElementResolver formElementResolver) Deprecated, for removal: This API element is subject to removal in a future version.DefaultFieldGenerator
(EnumOptionFetcher<?> enumOptionFetcher, EnumRadioFetcher<?> enumRadioFetcher, EnumCheckboxFetcher<?> enumCheckboxFetcher, io.micronaut.context.BeanContext beanContext, FormElementResolver formElementResolver, List<FieldsetConsumer> fieldsetConsumers) -
Method Summary
Modifier and TypeMethodDescription<T> @NonNull Fieldset
<T> Fieldset
generate
(@NonNull Class<T> type, @NonNull BiConsumer<String, io.micronaut.core.beans.BeanIntrospection.Builder<? extends FormElement>> builderConsumer) @NonNull Fieldset
generate
(@NonNull Object instance, @NonNull BiConsumer<String, io.micronaut.core.beans.BeanIntrospection.Builder<? extends FormElement>> builderConsumer) generate
(Object instance, jakarta.validation.ConstraintViolationException ex, BiConsumer<String, io.micronaut.core.beans.BeanIntrospection.Builder<? extends FormElement>> builderConsumer)
-
Constructor Details
-
DefaultFieldGenerator
@Inject public DefaultFieldGenerator(EnumOptionFetcher<?> enumOptionFetcher, EnumRadioFetcher<?> enumRadioFetcher, EnumCheckboxFetcher<?> enumCheckboxFetcher, io.micronaut.context.BeanContext beanContext, FormElementResolver formElementResolver, List<FieldsetConsumer> fieldsetConsumers) - Parameters:
enumOptionFetcher
- Enum fetcher forOption
.enumRadioFetcher
- Enum fetcher forRadio
.enumCheckboxFetcher
- Enum fetcher forCheckbox
.beanContext
- Bean ContextformElementResolver
- Primary Form Element Resolver.CompositeFormElementResolver
.fieldsetConsumers
- Fieldset Consumers
-
DefaultFieldGenerator
@Deprecated(forRemoval=true, since="5.6.0") public DefaultFieldGenerator(EnumOptionFetcher<?> enumOptionFetcher, EnumRadioFetcher<?> enumRadioFetcher, EnumCheckboxFetcher<?> enumCheckboxFetcher, io.micronaut.context.BeanContext beanContext, FormElementResolver formElementResolver) Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
enumOptionFetcher
- Enum fetcher forOption
.enumRadioFetcher
- Enum fetcher forRadio
.enumCheckboxFetcher
- Enum fetcher forCheckbox
.beanContext
- Bean ContextformElementResolver
- Primary Form Element Resolver.CompositeFormElementResolver
.
-
-
Method Details
-
generate
- Specified by:
generate
in interfaceFieldsetGenerator
- Type Parameters:
T
- type- Parameters:
type
- A class which should beIntrospected
.- Returns:
- A Fieldset
-
generate
public <T> Fieldset generate(@NonNull @NonNull Class<T> type, @NonNull @NonNull BiConsumer<String, io.micronaut.core.beans.BeanIntrospection.Builder<? extends FormElement>> builderConsumer) - Specified by:
generate
in interfaceFieldsetGenerator
- Type Parameters:
T
- type- Parameters:
type
- A class which should beIntrospected
.builderConsumer
- A biconsumer with the property name and the builder- Returns:
- A Fieldset
-
generate
- Specified by:
generate
in interfaceFieldsetGenerator
- Parameters:
instance
- The Object instance which should beIntrospected
.- Returns:
- A Fieldset
-
generate
@NonNull public @NonNull Fieldset generate(@NonNull @NonNull Object instance, @NonNull @NonNull BiConsumer<String, io.micronaut.core.beans.BeanIntrospection.Builder<? extends FormElement>> builderConsumer) - Specified by:
generate
in interfaceFieldsetGenerator
- Parameters:
instance
- The Object instance which should beIntrospected
.builderConsumer
- A biconsumer with the property name and the builder- Returns:
- A Fieldset
-
generate
public Fieldset generate(@NonNull @NonNull Object instance, @NonNull @NonNull jakarta.validation.ConstraintViolationException ex) - Specified by:
generate
in interfaceFieldsetGenerator
- Parameters:
instance
- The Object instance which should beIntrospected
.ex
- A Validation exception- Returns:
- A Fieldset
-
generate
public Fieldset generate(Object instance, jakarta.validation.ConstraintViolationException ex, BiConsumer<String, io.micronaut.core.beans.BeanIntrospection.Builder<? extends FormElement>> builderConsumer) - Specified by:
generate
in interfaceFieldsetGenerator
- Parameters:
instance
- The Object instance which should beIntrospected
.ex
- A Validation exceptionbuilderConsumer
- A biconsumer with the property name and the builder- Returns:
- A Fieldset
-
DefaultFieldGenerator(io.micronaut.views.fields.fetchers.EnumOptionFetcher<?>,io.micronaut.views.fields.fetchers.EnumRadioFetcher<?>,io.micronaut.views.fields.fetchers.EnumCheckboxFetcher<?>,io.micronaut.context.BeanContext,io.micronaut.views.fields.formelementresolvers.FormElementResolver,java.util.List<io.micronaut.views.fields.FieldsetConsumer>)
instead.