Interface FieldBuilderContext
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
FieldBuilderContextImpl
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 Summary
Modifier and TypeMethodDescriptionClass<?>
Get the bean type for which the field is being built.Get the static information (annotations, annotated method, etc.) associated with this context.default Method
Get the method that was annotated.default Class<?>
Determine theDataProvider
data model type from the annotated method's return type.
-
Method Details
-
getBindingInfo
AbstractFieldBuilder<?,?>.BindingInfo getBindingInfo()Get the static information (annotations, annotated method, etc.) associated with this context.- Returns:
- builder
-
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
Determine theDataProvider
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 ofCollection
, in which case the data model type is the collection's element type.
-