Class DefaultChoiceTransitionConfigurer<S,E>
java.lang.Object
org.springframework.statemachine.config.common.annotation.AnnotationConfigurerAdapter<TransitionsData<S,E>,StateMachineTransitionConfigurer<S,E>,StateMachineTransitionBuilder<S,E>>
org.springframework.statemachine.config.configurers.DefaultChoiceTransitionConfigurer<S,E>
- Type Parameters:
S
- the type of stateE
- the type of event
- All Implemented Interfaces:
AnnotationConfigurer<TransitionsData<S,
,E>, StateMachineTransitionBuilder<S, E>> AnnotationConfigurerBuilder<StateMachineTransitionConfigurer<S,
,E>> ChoiceTransitionConfigurer<S,
E>
public class DefaultChoiceTransitionConfigurer<S,E>
extends AnnotationConfigurerAdapter<TransitionsData<S,E>,StateMachineTransitionConfigurer<S,E>,StateMachineTransitionBuilder<S,E>>
implements ChoiceTransitionConfigurer<S,E>
Default implementation of a
ChoiceTransitionConfigurer
.- Author:
- Janne Valkealahti
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(StateMachineTransitionBuilder<S, E> builder) Configure theAnnotationBuilder
by setting the necessary properties on theAnnotationBuilder
.Specify a target stateS
as a first choice.Specify a target stateS
as a first choice associating anAction
to outgoing vertex.Specify a target stateS
as a first choice associating anAction
to outgoing vertex.Specify a target stateS
as a last choice.Specify a target stateS
as a last choice associating anAction
to outgoing vertex.Specify a target stateS
as a last choice associating anAction
to outgoing vertex.Specify a source stateS
for thisTransition
.Specify a target stateS
as a then choice.Specify a target stateS
as a then choice associating anAction
to outgoing vertex.Specify a target stateS
as a then choice associating anAction
to outgoing vertex.Methods inherited from class org.springframework.statemachine.config.common.annotation.AnnotationConfigurerAdapter
addObjectPostProcessor, and, getBuilder, init, isAssignable, setBuilder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.statemachine.config.common.annotation.AnnotationConfigurerBuilder
and
-
Constructor Details
-
DefaultChoiceTransitionConfigurer
public DefaultChoiceTransitionConfigurer()
-
-
Method Details
-
configure
Description copied from interface:AnnotationConfigurer
Configure theAnnotationBuilder
by setting the necessary properties on theAnnotationBuilder
.- Specified by:
configure
in interfaceAnnotationConfigurer<S,
E> - Overrides:
configure
in classAnnotationConfigurerAdapter<TransitionsData<S,
E>, StateMachineTransitionConfigurer<S, E>, StateMachineTransitionBuilder<S, E>> - Parameters:
builder
- the builder- Throws:
Exception
- if error occurred
-
source
Description copied from interface:ChoiceTransitionConfigurer
Specify a source stateS
for thisTransition
.- Specified by:
source
in interfaceChoiceTransitionConfigurer<S,
E> - Parameters:
source
- the source stateS
- Returns:
- configurer for chaining
-
first
Description copied from interface:ChoiceTransitionConfigurer
Specify a target stateS
as a first choice. This must be set.In normal if/else if/else this would represent if.
- Specified by:
first
in interfaceChoiceTransitionConfigurer<S,
E> - Parameters:
target
- the target stateguard
- the guard for this choice- Returns:
- configurer for chaining
-
first
Description copied from interface:ChoiceTransitionConfigurer
Specify a target stateS
as a first choice associating anAction
to outgoing vertex. This must be set.In normal if/else if/else this would represent if.
- Specified by:
first
in interfaceChoiceTransitionConfigurer<S,
E> - Parameters:
target
- the target stateguard
- the guard for this choiceaction
- the action- Returns:
- configurer for chaining
-
first
public ChoiceTransitionConfigurer<S,E> first(S target, Guard<S, E> guard, Action<S, E> action, Action<S, E> error) Description copied from interface:ChoiceTransitionConfigurer
Specify a target stateS
as a first choice associating anAction
to outgoing vertex. This must be set.In normal if/else if/else this would represent if.
- Specified by:
first
in interfaceChoiceTransitionConfigurer<S,
E> - Parameters:
target
- the target stateguard
- the guard for this choiceaction
- the actionerror
- action that will be called if any unexpected exception is thrown by the action.- Returns:
- configurer for chaining
-
then
Description copied from interface:ChoiceTransitionConfigurer
Specify a target stateS
as a then choice. This is optional. Multiple thens will preserve order.In normal if/else if/else this would represent else if.
- Specified by:
then
in interfaceChoiceTransitionConfigurer<S,
E> - Parameters:
target
- the target stateguard
- the guard for this choice- Returns:
- configurer for chaining
-
then
Description copied from interface:ChoiceTransitionConfigurer
Specify a target stateS
as a then choice associating anAction
to outgoing vertex. This is optional. Multiple thens will preserve order.In normal if/else if/else this would represent else if.
- Specified by:
then
in interfaceChoiceTransitionConfigurer<S,
E> - Parameters:
target
- the target stateguard
- the guard for this choiceaction
- the action- Returns:
- configurer for chaining
-
then
public ChoiceTransitionConfigurer<S,E> then(S target, Guard<S, E> guard, Action<S, E> action, Action<S, E> error) Description copied from interface:ChoiceTransitionConfigurer
Specify a target stateS
as a then choice associating anAction
to outgoing vertex. This is optional. Multiple thens will preserve order.In normal if/else if/else this would represent else if.
- Specified by:
then
in interfaceChoiceTransitionConfigurer<S,
E> - Parameters:
target
- the target stateguard
- the guard for this choiceaction
- the actionerror
- action that will be called if any unexpected exception is thrown by the action.- Returns:
- configurer for chaining
-
last
Description copied from interface:ChoiceTransitionConfigurer
Specify a target stateS
as a last choice. This must be set.In normal if/else if/else this would represent else.
- Specified by:
last
in interfaceChoiceTransitionConfigurer<S,
E> - Parameters:
target
- the target state- Returns:
- configurer for chaining
-
last
Description copied from interface:ChoiceTransitionConfigurer
Specify a target stateS
as a last choice associating anAction
to outgoing vertex. This must be set.In normal if/else if/else this would represent else.
- Specified by:
last
in interfaceChoiceTransitionConfigurer<S,
E> - Parameters:
target
- the target stateaction
- the action- Returns:
- configurer for chaining
-
last
Description copied from interface:ChoiceTransitionConfigurer
Specify a target stateS
as a last choice associating anAction
to outgoing vertex. This must be set.In normal if/else if/else this would represent else.
- Specified by:
last
in interfaceChoiceTransitionConfigurer<S,
E> - Parameters:
target
- the target stateaction
- the actionerror
- action that will be called if any unexpected exception is thrown by the action.- Returns:
- configurer for chaining
-