Package org.apache.directory.api.dsmlv2
Class GrammarTransition
- java.lang.Object
-
- org.apache.directory.api.dsmlv2.GrammarTransition
-
public class GrammarTransition extends Object
Define a transition between two states of a grammar. It stores the next state, and the action to execute while transiting.- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description GrammarTransition(Enum<Dsmlv2StatesEnum> currentState, Enum<Dsmlv2StatesEnum> nextState, GrammarAction action)
Creates a new GrammarTransition object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GrammarAction
getAction()
Gets the action associated with the transitionEnum<Dsmlv2StatesEnum>
getNextState()
Gets the target stateboolean
hasAction()
Tells if the transition has an associated action.String
toString(int grammar, Enum<Dsmlv2StatesEnum> statesEnum)
Returns a representation of the transition as a string
-
-
-
Constructor Detail
-
GrammarTransition
public GrammarTransition(Enum<Dsmlv2StatesEnum> currentState, Enum<Dsmlv2StatesEnum> nextState, GrammarAction action)
Creates a new GrammarTransition object.- Parameters:
currentState
- The current transitionnextState
- The target stateaction
- The action to execute. It could be null.
-
-
Method Detail
-
getNextState
public Enum<Dsmlv2StatesEnum> getNextState()
Gets the target state- Returns:
- the target state.
-
hasAction
public boolean hasAction()
Tells if the transition has an associated action.- Returns:
true
if an action has been associated to the transition
-
getAction
public GrammarAction getAction()
Gets the action associated with the transition- Returns:
- the action associated with the transition
-
toString
public String toString(int grammar, Enum<Dsmlv2StatesEnum> statesEnum)
Returns a representation of the transition as a string- Parameters:
grammar
- the grammar which state we want a String fromstatesEnum
- the states enum that contains the states' names- Returns:
- a representation of the transition as a string.
-
-