public class MethodSelfTransition extends AbstractSelfTransition
SelfTransition
which invokes a Method
. The Method
can
have zero or any number of StateContext and State regarding order
Normally you wouldn't create instances of this class directly but rather use
the SelfTransition
annotation to define the methods which should be
used as transitions in your state machine and then let
StateMachineFactory
create a
StateMachine
for you.
构造器和说明 |
---|
MethodSelfTransition(java.lang.reflect.Method method,
java.lang.Object target) |
MethodSelfTransition(java.lang.String methodName,
java.lang.Object target)
Creates a new instance
|
限定符和类型 | 方法和说明 |
---|---|
boolean |
doExecute(StateContext stateContext,
State state)
Executes this
SelfTransition . |
java.lang.reflect.Method |
getMethod() |
execute
public MethodSelfTransition(java.lang.reflect.Method method, java.lang.Object target)
public MethodSelfTransition(java.lang.String methodName, java.lang.Object target)
methodName
- the target method.target
- the target object.public java.lang.reflect.Method getMethod()
Method
.public boolean doExecute(StateContext stateContext, State state)
AbstractSelfTransition
SelfTransition
.doExecute
在类中 AbstractSelfTransition
stateContext
- the context in which the execution should occurstate
- the current stateSelfTransition
has been executed
successfully