Class AbstractFieldBuilder.BindingInfo
java.lang.Object
org.dellroad.stuff.vaadin24.field.AbstractFieldBuilder.BindingInfo
- Enclosing class:
- AbstractFieldBuilder<S extends AbstractFieldBuilder<S,T>, T> 
FieldBuilder static configuration information for one bean property.
 This class captures the information gathered from these annotations for some bean property:
- @FieldBuilder.Foo(for some widget class- Foo)
- @FieldBuilder.ProvidesField
- @FieldBuilder.Binding
- @FieldBuilder.FormLayout
- @FieldBuilder.NullifyCheckbox
- @FieldBuilder.EnabledBy
Instances are immutable.
- 
Constructor SummaryConstructorsConstructorDescriptionBindingInfo(Method method, String propertyName, Annotation annotation, AbstractFieldBuilder.Binding binding, AbstractFieldBuilder.FormLayout formLayout, AbstractFieldBuilder.NullifyCheckbox nullifyCheckbox, AbstractFieldBuilder.EnabledBy enabledBy, BiFunction<AbstractFieldBuilder<S, T>.BindingInfo, ? super T, FieldComponent<?>> fieldBuilder) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionaddField(FormLayout formLayout, Component component) Add the given component to the givenFormLayoutaccording to this instance.protected <T> FieldComponent<T>addNullifyCheckbox(FieldComponent<T> fieldComponent) <V> Binder.Binding<? extends T,?> Bind the given field to the givenBinderaccording to this instance.createFieldComponent(T bean) Instantiate a new field and associated component according to this instance.Get the (@FieldBuilder.Fooor@FieldBuilder.ProvidesField) annotation that annotates the method from which this instance originated.Get the associated@FieldBuilder.Bindingannotation, if any.Get the associated@FieldBuilder.EnabledByannotation, if any.Return theAbstractFieldBuilderthat created this instance.Get the associated@FieldBuilder.FormLayoutannotation, if any.protected StringFind a public zero-arg methodgetLabelreturningStringand invoke it, if it exists.Get the annotated method associated with this instance.Get the associated@FieldBuilder.NullifyCheckboxannotation, if any.Get a description of the origin of this instance (method and annotation).Return the property name associated with this instance.doubleGenerate a sorting value for this field.protected <T> Tinstantiate(Class<T> type) Instantiate a field (or whatever) from the givenClass.toString()
- 
Constructor Details- 
BindingInfopublic BindingInfo(Method method, String propertyName, Annotation annotation, AbstractFieldBuilder.Binding binding, AbstractFieldBuilder.FormLayout formLayout, AbstractFieldBuilder.NullifyCheckbox nullifyCheckbox, AbstractFieldBuilder.EnabledBy enabledBy, BiFunction<AbstractFieldBuilder<S, T>.BindingInfo, ? super T, FieldComponent<?>> fieldBuilder) Constructor.- Parameters:
- method- annotated method
- propertyName- property name
- annotation- annotation found on- method
- binding- associated- @FieldBuilder.Bindingannotation, if any
- formLayout- associated- @FieldBuilder.FormLayoutannotation, if any
- nullifyCheckbox- associated- @FieldBuilder.NullifyCheckbox, if any
- enabledBy- associated from- @FieldBuilder.EnabledBy, if any
- fieldBuilder- builds the field
- Throws:
- IllegalArgumentException- if- method,- propertyName,- annotation, or- fieldBuilderis null
 
 
- 
- 
Method Details- 
getFieldBuilderReturn theAbstractFieldBuilderthat created this instance.- Returns:
- associated field builder
 
- 
getMethodGet the annotated method associated with this instance.This is the method that is annotated with the @FieldBuilder.Fooannotation. Note that the other annotations (e.g.,@FieldBuilder.Binding) could possibly have come from different methods (they would necessarily be overriding or overridden versions of this method).- Returns:
- associated method
 
- 
getPropertyNameReturn the property name associated with this instance.- Returns:
- associated property name
 
- 
getAnnotationGet the (@FieldBuilder.Fooor@FieldBuilder.ProvidesField) annotation that annotates the method from which this instance originated.- Returns:
- associated annotation type
 
- 
getBindingGet the associated@FieldBuilder.Bindingannotation, if any.- Returns:
- associated @FieldBuilder.Bindingannotation, or null if none
 
- 
getFormLayoutGet the associated@FieldBuilder.FormLayoutannotation, if any.- Returns:
- associated @FieldBuilder.FormLayoutannotation, or null if none
 
- 
getNullifyCheckboxGet the associated@FieldBuilder.NullifyCheckboxannotation, if any.- Returns:
- associated @FieldBuilder.NullifyCheckboxannotation, or null if none
 
- 
getEnabledByGet the associated@FieldBuilder.EnabledByannotation, if any.- Returns:
- associated @FieldBuilder.EnabledByannotation, or null if none
 
- 
getSortOrderpublic double getSortOrder()Generate a sorting value for this field.- Returns:
- sort order value
 
- 
getOriginGet a description of the origin of this instance (method and annotation).- Returns:
- origin description
 
- 
instantiateInstantiate a field (or whatever) from the givenClass.We use the FieldBuilderContextconstructor if available, otherwise default constructor.- Parameters:
- type- expected type of thing we're instantiating
 
- 
createFieldComponentInstantiate a new field and associated component according to this instance.- Parameters:
- bean- instance bean, or null if none available
- Returns:
- new field and associated component
- Throws:
- IllegalArgumentException- if a bean instance is required but- beanis null
 
- 
addNullifyCheckbox
- 
bindBind the given field to the givenBinderaccording to this instance.- Type Parameters:
- V- field value type
- Parameters:
- binder- binder to bind new field to
- field- field to bind
- Returns:
- the new binding
- Throws:
- IllegalArgumentException- if either parameter is null
 
- 
addFieldAdd the given component to the givenFormLayoutaccording to this instance.- Parameters:
- formLayout- target layout
- component- field component to add
- Returns:
- the added FormLayout.FormItem
- Throws:
- IllegalArgumentException- if either parameter is null
 
- 
getLabelFind a public zero-arg methodgetLabelreturningStringand invoke it, if it exists.- Parameters:
- obj- target object
- Returns:
- the returned label, or null on failure
 
- 
toString
 
-