|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.data.hadoop.config.common.annotation.AbstractAnnotationBuilder<O> org.springframework.data.hadoop.config.common.annotation.AbstractConfiguredAnnotationBuilder<O,I,B>
O
- The object that this builder returnsI
- B
- The type of this builder (that is returned by the base class)public abstract class AbstractConfiguredAnnotationBuilder<O,I,B extends AnnotationBuilder<O>>
A base AnnotationBuilder
that allows AnnotationConfigurer
s to be
applied to it. This makes modifying the AnnotationBuilder
a strategy
that can be customised and broken up into a number of
AnnotationConfigurer
objects that have more specific goals than that
of the AnnotationBuilder
.
Constructor Summary | |
---|---|
protected |
AbstractConfiguredAnnotationBuilder()
Instantiates a new annotation builder. |
protected |
AbstractConfiguredAnnotationBuilder(ObjectPostProcessor<java.lang.Object> objectPostProcessor)
Instantiates a new annotation builder. |
protected |
AbstractConfiguredAnnotationBuilder(ObjectPostProcessor<java.lang.Object> objectPostProcessor,
boolean allowConfigurersOfSameType)
Instantiates a new annotation builder. |
Method Summary | ||
---|---|---|
|
apply(C configurer)
Applies a AnnotationConfigurer to this AnnotationBuilder
overriding any AnnotationConfigurer of the exact same class. |
|
|
apply(C configurer)
Applies a AnnotationConfigurerAdapter to this
AnnotationBuilder and invokes
AnnotationConfigurerAdapter.setBuilder(AnnotationBuilder) . |
|
protected void |
beforeConfigureMains()
Invoked prior to invoking each main AnnotationConfigurer.configure(AnnotationBuilder) method. |
|
protected void |
beforeConfigurePosts()
Invoked prior to invoking each post AnnotationConfigurer.configure(AnnotationBuilder) method. |
|
protected void |
beforeInit()
Invoked prior to invoking each AnnotationConfigurer.init(AnnotationBuilder) method. |
|
protected O |
doBuild()
Subclasses should implement this to perform the build. |
|
|
getConfigurer(java.lang.Class<C> clazz)
Gets the AnnotationConfigurer by its class name or
null if not found. |
|
|
getConfigurers(java.lang.Class<C> clazz)
Gets all the AnnotationConfigurer instances by its class name or an
empty List if not found. |
|
|
getOrApply(C configurer)
Similar to apply(AnnotationConfigurer) but checks the state
to determine if apply(AnnotationConfigurer) needs to be called first. |
|
O |
getOrBuild()
Similar to AbstractAnnotationBuilder.build() and AbstractAnnotationBuilder.getObject() but checks the state
to determine if AbstractAnnotationBuilder.build() needs to be called first. |
|
|
getSharedObject(java.lang.Class<C> sharedType)
Gets a shared Object. |
|
java.util.Map<java.lang.Class<java.lang.Object>,java.lang.Object> |
getSharedObjects()
Gets the shared objects. |
|
O |
objectPostProcessor(ObjectPostProcessor<java.lang.Object> objectPostProcessor)
Specifies the ObjectPostProcessor to use. |
|
protected abstract O |
performBuild()
Subclasses must implement this method to build the object that is being returned. |
|
protected
|
postProcess(P object)
Performs post processing of an object. |
|
|
removeConfigurer(java.lang.Class<C> clazz)
Removes and returns the AnnotationConfigurer by its class name or
null if not found. |
|
|
removeConfigurers(java.lang.Class<C> clazz)
Removes all the AnnotationConfigurer instances by its class name or an
empty List if not found. |
|
|
setSharedObject(java.lang.Class<C> sharedType,
C object)
Sets an object that is shared by multiple AnnotationConfigurer . |
Methods inherited from class org.springframework.data.hadoop.config.common.annotation.AbstractAnnotationBuilder |
---|
build, getObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractConfiguredAnnotationBuilder()
protected AbstractConfiguredAnnotationBuilder(ObjectPostProcessor<java.lang.Object> objectPostProcessor)
objectPostProcessor
- the object post processorprotected AbstractConfiguredAnnotationBuilder(ObjectPostProcessor<java.lang.Object> objectPostProcessor, boolean allowConfigurersOfSameType)
objectPostProcessor
- the object post processorallowConfigurersOfSameType
- the allow configurers of same typeMethod Detail |
---|
protected final O doBuild() throws java.lang.Exception
AbstractAnnotationBuilder
doBuild
in class AbstractAnnotationBuilder<O>
AbstractAnnotationBuilder.build()
.
java.lang.Exception
- if an error occurspublic O getOrBuild()
AbstractAnnotationBuilder.build()
and AbstractAnnotationBuilder.getObject()
but checks the state
to determine if AbstractAnnotationBuilder.build()
needs to be called first.
AbstractAnnotationBuilder.build()
or AbstractAnnotationBuilder.getObject()
. If an
error occurs while building, returns null.public <C extends AnnotationConfigurerAdapter<O,I,B>> C apply(C configurer) throws java.lang.Exception
AnnotationConfigurerAdapter
to this
AnnotationBuilder
and invokes
AnnotationConfigurerAdapter.setBuilder(AnnotationBuilder)
.
configurer
- the configurer
java.lang.Exception
- if error occurredpublic <C extends AnnotationConfigurerAdapter<O,I,B>> C getOrApply(C configurer) throws java.lang.Exception
apply(AnnotationConfigurer)
but checks the state
to determine if apply(AnnotationConfigurer)
needs to be called first.
configurer
- the configurer
java.lang.Exception
- if error occurredpublic <C extends AnnotationConfigurer<O,B>> C apply(C configurer) throws java.lang.Exception
AnnotationConfigurer
to this AnnotationBuilder
overriding any AnnotationConfigurer
of the exact same class. Note
that object hierarchies are not considered.
configurer
- the configurer
java.lang.Exception
- if error occurredpublic <C> void setSharedObject(java.lang.Class<C> sharedType, C object)
AnnotationConfigurer
.
sharedType
- the Class to key the shared object by.object
- the Object to storepublic <C> C getSharedObject(java.lang.Class<C> sharedType)
sharedType
- the type of the shared Object
public java.util.Map<java.lang.Class<java.lang.Object>,java.lang.Object> getSharedObjects()
public <C extends AnnotationConfigurer<O,B>> java.util.List<C> getConfigurers(java.lang.Class<C> clazz)
AnnotationConfigurer
instances by its class name or an
empty List if not found. Note that object hierarchies are not considered.
clazz
- the AnnotationConfigurer
class to look for
public <C extends AnnotationConfigurer<O,B>> java.util.List<C> removeConfigurers(java.lang.Class<C> clazz)
AnnotationConfigurer
instances by its class name or an
empty List if not found. Note that object hierarchies are not considered.
clazz
- the AnnotationConfigurer
class to look for
public <C extends AnnotationConfigurer<O,B>> C getConfigurer(java.lang.Class<C> clazz)
AnnotationConfigurer
by its class name or
null
if not found. Note that object hierarchies are not
considered.
clazz
- the configurer class type
public <C extends AnnotationConfigurer<O,B>> C removeConfigurer(java.lang.Class<C> clazz)
AnnotationConfigurer
by its class name or
null
if not found. Note that object hierarchies are not
considered.
clazz
- the configurer class type
public O objectPostProcessor(ObjectPostProcessor<java.lang.Object> objectPostProcessor)
ObjectPostProcessor
to use.
objectPostProcessor
- the ObjectPostProcessor
to use. Cannot be null
AnnotationBuilder
for further customizationsprotected <P> P postProcess(P object)
ObjectPostProcessor
.
object
- the Object to post process
protected void beforeInit() throws java.lang.Exception
AnnotationConfigurer.init(AnnotationBuilder)
method. Subclasses may
override this method to hook into the lifecycle without using a
AnnotationConfigurer
.
java.lang.Exception
protected void beforeConfigureMains() throws java.lang.Exception
AnnotationConfigurer.configure(AnnotationBuilder)
method.
Subclasses may override this method to hook into the lifecycle without
using a AnnotationConfigurer
.
java.lang.Exception
protected void beforeConfigurePosts() throws java.lang.Exception
AnnotationConfigurer.configure(AnnotationBuilder)
method.
Subclasses may override this method to hook into the lifecycle without
using a AnnotationConfigurer
.
java.lang.Exception
protected abstract O performBuild() throws java.lang.Exception
java.lang.Exception
|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |