Class GrammarTransition<C extends Asn1Container>

java.lang.Object
org.apache.directory.api.asn1.ber.grammar.GrammarTransition<C>
Type Parameters:
C - The container type

public class GrammarTransition<C extends Asn1Container> extends Object
Define a transition between two states of a grammar. It stores the next state, and the action to execute while executing the transition.
Author:
Apache Directory Project
  • Constructor Details

    • GrammarTransition

      public GrammarTransition(Enum<?> previousState, Enum<?> currentState, int currentTag, Action<C> action, Grammar.FollowUp followUp)
      Creates a new GrammarTransition object.
      Parameters:
      previousState - the previous state
      currentState - The current state
      currentTag - the current TLV's tag
      action - The action to execute. It could be null.
      followUp - if the current TLV has a follow up in the current PDU
    • GrammarTransition

      public GrammarTransition(Enum<?> previousState, Enum<?> currentState, int currentTag, Grammar.FollowUp followUp)
      Creates a new GrammarTransition object.
      Parameters:
      previousState - the previous state
      currentState - The current state
      currentTag - the current TLV's tag
      followUp - if the current TLV has a follow up in the current PDU
    • GrammarTransition

      public GrammarTransition(Enum<?> previousState, Enum<?> currentState, UniversalTag currentTag, Action<C> action, Grammar.FollowUp followUp)
      Creates a new GrammarTransition object.
      Parameters:
      previousState - the previous state
      currentState - The current state
      currentTag - the current TLV's tag
      action - The action to execute. It could be null.
      followUp - if the current TLV has a follow up in the current PDU
    • GrammarTransition

      public GrammarTransition(Enum<?> previousState, Enum<?> currentState, UniversalTag currentTag, Grammar.FollowUp followUp)
      Creates a new GrammarTransition object.
      Parameters:
      previousState - the previous state
      currentState - The current state
      currentTag - the current TLV's tag
      followUp - if the current TLV has a follow up in the current PDU
  • Method Details

    • 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 Action<C> getAction()
      Get the transition's action
      Returns:
      Returns the action associated with the transition
    • getCurrentState

      public Enum<?> getCurrentState()
      Get the current state
      Returns:
      The current state
    • getPreviousState

      public Enum<?> getPreviousState()
      Get the previous state
      Returns:
      The previous state
    • hasFollowUp

      public boolean hasFollowUp()
      Get the followUp flag
      Returns:
      the followUp flag
    • setFollowUp

      public void setFollowUp(Grammar.FollowUp followUp)
      Set the followUp flag
      Parameters:
      followUp - the followUp flag to set
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      A representation of the transition as a string.