Package org.apache.juneau
Class BeanBuilder<T>
java.lang.Object
org.apache.juneau.BeanBuilder<T>
- Type Parameters:
T
- The bean type that the builder creates.
- Direct Known Subclasses:
CallLoggerRule.Builder
,EncoderSet.Builder
,FileFinder.Builder
,Messages.Builder
,MethodExecStats.Builder
,MethodExecStore.Builder
,ParserSet.Builder
,ResponseProcessorList.Builder
,RestChildren.Builder
,RestConverterList.Builder
,RestGuardList.Builder
,RestMatcherList.Builder
,RestOpArgList.Builder
,RestOperations.Builder
,SerializerSet.Builder
,StaticFiles.Builder
,ThrownStore.Builder
,VarResolver.Builder
Base class for bean builders.
See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
BeanBuilder
(Class<? extends T> defaultType) Constructor.protected
BeanBuilder
(Class<? extends T> defaultType, BeanStore beanStore) Constructor.protected
BeanBuilder
(BeanBuilder<T> copyFrom) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the bean store passed in through the constructor.build()
Creates the bean.protected T
Creates the bean when the bean type isnull or is the default value.protected BeanCreator<? extends T>
creator()
Instantiates the creator for this bean.impl()
Returns the override bean specified viaimpl(Object)
.Overrides the bean returned by thebuild()
method.type()
Returns the implementation type specified viatype(Class)
.Overrides the bean type produced by thebuild()
method.
-
Constructor Details
-
BeanBuilder
Constructor.- Parameters:
beanStore
- The bean store to use for creating beans.defaultType
- The default bean type that this builder creates.
-
BeanBuilder
Constructor.- Parameters:
defaultType
- The type of bean being created.
-
BeanBuilder
Copy constructor.- Parameters:
copyFrom
- The bean store to copy from.
-
-
Method Details
-
build
Creates the bean.- Returns:
- A new bean.
-
creator
Instantiates the creator for this bean.Subclasses can override this to provide specialized handling.
- Returns:
- The creator for this bean.
-
buildDefault
Creates the bean when the bean type isnull or is the default value.- Returns:
- A new bean.
-
type
Overrides the bean type produced by thebuild()
method.Use this method if you want to instantiated a bean subclass.
- Parameters:
value
- The setting value.- Returns:
- This object.
-
type
Returns the implementation type specified viatype(Class)
.- Returns:
- The implementation type specified via
type(Class)
.
-
impl
Overrides the bean returned by thebuild()
method.Use this method if you want this builder to return an already-instantiated bean.
- Parameters:
value
- The setting value.- Returns:
- This object.
-
impl
Returns the override bean specified viaimpl(Object)
.- Returns:
- The override bean specified via
impl(Object)
.
-
beanStore
Returns the bean store passed in through the constructor.- Returns:
- The bean store passed in through the constructor.
-