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.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBeanBuilder(Class<? extends T> defaultType, BeanStore beanStore) Constructor.protectedBeanBuilder(BeanBuilder<T> copyFrom) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the bean store passed in through the constructor.build()Creates the bean.protected TCreates 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
Copy constructor.- Parameters:
copyFrom- The bean store to copy from.
-
BeanBuilder
Constructor.- Parameters:
beanStore- The bean store to use for creating beans.defaultType- The default bean type that this builder creates.
-
-
Method Details
-
beanStore
Returns the bean store passed in through the constructor.- Returns:
- The bean store passed in through the constructor.
-
build
Creates the bean.- Returns:
- A new bean.
-
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.
-
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.
-
buildDefault
Creates the bean when the bean type isnull or is the default value.- 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.
-
impl
Returns the override bean specified viaimpl(Object).- Returns:
- The override bean specified via
impl(Object).
-
type
Returns the implementation type specified viatype(Class).- Returns:
- The implementation type specified via
type(Class).
-