Interface FieldBuilderContext

All Superinterfaces:
Serializable
All Known Implementing Classes:
FieldBuilderContextImpl

public interface FieldBuilderContext extends Serializable
Provides context when fields are instantiated automatically based on method annotations by an AbstractFieldBuilder.

Fields and other related classes (data providers, renderers, etc.) can declare constructors taking one of these in order to be provided with more context during construction.

See Also:
  • Method Details

    • getBindingInfo

      AbstractFieldBuilder<?,?>.BindingInfo getBindingInfo()
      Get the static information (annotations, annotated method, etc.) associated with this context.
      Returns:
      builder
    • getMethod

      default Method getMethod()
      Get the method that was annotated.

      The implementation in FieldBuilderContext just returns #getBindingInfo().getMethod().

      Returns:
      the method having the annotation on which the new field is based
    • getBeanType

      Class<?> getBeanType()
      Get the bean type for which the field is being built.

      This will either be the declaring class (or interface) of the annotated method, or possibly a subclass of that class if the annotated method is declared in a supertype.

      Returns:
      the method having the annotation on which the new field is based
    • inferDataModelType

      default Class<?> inferDataModelType()
      Determine the DataProvider data model type from the annotated method's return type.

      This information is needed in order to automatically create certain DataProvider's that need to know the data model type.

      The default implementation in FieldBuilderContext assumes the data model type is the method's return type, unless the return type is a sub-type of Collection, in which case the data model type is the collection's element type.