Package org.apache.juneau.cp
Class ContextBeanCreator<T>
java.lang.Object
org.apache.juneau.cp.ContextBeanCreator<T>
- Type Parameters:
- T- The bean type.
- Direct Known Subclasses:
- HttpPartParser.Creator,- HttpPartSerializer.Creator
Utility class for instantiating a Context bean.
 
Contains either a pre-existing Context bean, or a builder for that bean. If it's a builder, then annotations can be applied to it.
See Also:
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedContextBeanCreator(Class<T> type) Constructor.protectedContextBeanCreator(ContextBeanCreator<T> copyFrom) Copy constructor.
- 
Method SummaryModifier and TypeMethodDescriptionapply(AnnotationWorkList work) Applies the specified annotations to all applicable serializer builders in this group.<B extends Context.Builder>
 Optional<B>Returns access to the inner builder if the builder exists and is of the specified type.<B extends Context.Builder>
 ContextBeanCreator<T>Applies an operation to the builder in this creator object.booleancanApply(AnnotationWorkList work) Returns true if any of the annotations/appliers can be applied to the inner builder (if it has one).copy()Creates a new copy of this creator.create()Returns the built bean.static <T> ContextBeanCreator<T>Creator.Sets an already instantiated object on this creator.Sets the implementation type of the bean.
- 
Constructor Details- 
ContextBeanCreatorConstructor.- Parameters:
- type- The bean type.
 
- 
ContextBeanCreatorCopy constructor.- Parameters:
- copyFrom- The creator to copy from.
 
 
- 
- 
Method Details- 
createCreator.- Type Parameters:
- T- The bean type.
- Parameters:
- type- The bean type.
- Returns:
- A new creator object.
 
- 
implSets an already instantiated object on this creator.- Parameters:
- value- The bean to set.
- Returns:
- This object.
 
- 
typeSets the implementation type of the bean.The class type must extend from Contextand have a builder create method.- Parameters:
- value- The bean type.
- Returns:
- This object.
 
- 
builderReturns access to the inner builder if the builder exists and is of the specified type.- Type Parameters:
- B- The builder class type.
- Parameters:
- c- The builder class type.
- Returns:
- An optional containing the builder if it exists.
 
- 
builderApplies an operation to the builder in this creator object.Typically used to allow you to execute operations without breaking the fluent flow of the client builder. The operation is ignored if the builder isn't the specified type. - Type Parameters:
- B- The builder class type.
- Parameters:
- c- The builder class type.
- operation- The operation to apply.
- Returns:
- This object.
 
- 
canApplyReturns true if any of the annotations/appliers can be applied to the inner builder (if it has one).- Parameters:
- work- The work to check.
- Returns:
- This object.
 
- 
applyApplies the specified annotations to all applicable serializer builders in this group.- Parameters:
- work- The annotations to apply.
- Returns:
- This object.
 
- 
copyCreates a new copy of this creator.- Returns:
- A new copy of this creator.
 
- 
createReturns the built bean.- Returns:
- The built bean.
 
 
-