Class AnnotationConfigurerAdapter<O,I,B extends AnnotationBuilder<O>>
java.lang.Object
org.springframework.statemachine.config.common.annotation.AnnotationConfigurerAdapter<O,I,B>
- Type Parameters:
O
- The Object being built by BI
- The interface of type BB
- The Builder that is building O and is configured byAnnotationConfigurerAdapter
- All Implemented Interfaces:
AnnotationConfigurer<O,
B>
- Direct Known Subclasses:
AbstractTransitionConfigurer
,DefaultChoiceTransitionConfigurer
,DefaultConfigurationConfigurer
,DefaultDistributedStateMachineConfigurer
,DefaultEntryTransitionConfigurer
,DefaultExitTransitionConfigurer
,DefaultForkTransitionConfigurer
,DefaultHistoryTransitionConfigurer
,DefaultJoinTransitionConfigurer
,DefaultJunctionTransitionConfigurer
,DefaultModelConfigurer
,DefaultMonitoringConfigurer
,DefaultPersistenceConfigurer
,DefaultPropertiesConfigurer
,DefaultResourceConfigurer
,DefaultSecurityConfigurer
,DefaultStateConfigurer
,DefaultVerifierConfigurer
public abstract class AnnotationConfigurerAdapter<O,I,B extends AnnotationBuilder<O>>
extends Object
implements AnnotationConfigurer<O,B>
A base class for
AnnotationConfigurer
that allows subclasses to only
implement the methods they are interested in. It also provides a mechanism
for using the AnnotationConfigurer
and when done gaining access to the
AnnotationBuilder
that is being configured.- Author:
- Rob Winch, Janne Valkealahti
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addObjectPostProcessor
(ObjectPostProcessor<?> objectPostProcessor) Adds anObjectPostProcessor
to be used for this adapter.and()
Return theAnnotationBuilder
when done using theAnnotationConfigurer
.void
Configure theAnnotationBuilder
by setting the necessary properties on theAnnotationBuilder
.protected final B
Gets theAnnotationBuilder
.void
Initialise theAnnotationBuilder
.boolean
isAssignable
(AnnotationBuilder<O> builder) void
setBuilder
(B builder) Sets theAnnotationBuilder
to be used.
-
Constructor Details
-
AnnotationConfigurerAdapter
public AnnotationConfigurerAdapter()
-
-
Method Details
-
init
Description copied from interface:AnnotationConfigurer
Initialise theAnnotationBuilder
. Here only shared state should be created and modified, but not properties on theAnnotationBuilder
used for building the object. This ensures that theAnnotationConfigurer.configure(AnnotationBuilder)
method uses the correct shared objects when building.- Specified by:
init
in interfaceAnnotationConfigurer<O,
I> - Parameters:
builder
- the builder- Throws:
Exception
- if error occurred
-
configure
Description copied from interface:AnnotationConfigurer
Configure theAnnotationBuilder
by setting the necessary properties on theAnnotationBuilder
.- Specified by:
configure
in interfaceAnnotationConfigurer<O,
I> - Parameters:
builder
- the builder- Throws:
Exception
- if error occurred
-
and
Return theAnnotationBuilder
when done using theAnnotationConfigurer
. This is useful for method chaining.- Returns:
- the
AnnotationBuilder
-
getBuilder
Gets theAnnotationBuilder
. Cannot be null.- Returns:
- the
AnnotationBuilder
- Throws:
IllegalStateException
- if AnnotationBuilder is null
-
addObjectPostProcessor
Adds anObjectPostProcessor
to be used for this adapter. The default implementation does nothing to the object.- Parameters:
objectPostProcessor
- theObjectPostProcessor
to use
-
setBuilder
Sets theAnnotationBuilder
to be used. This is automatically set when usingAbstractConfiguredAnnotationBuilder.apply(AnnotationConfigurerAdapter)
- Parameters:
builder
- theAnnotationBuilder
to set
-
isAssignable
- Specified by:
isAssignable
in interfaceAnnotationConfigurer<O,
I>
-