public class TokenStateMachine
extends java.lang.Object
TokenReader
uses this transition map in order to control
the state-based parsing process.
For a given state (Class) there is a set of transitions states, which are
in represented as tokens.
Copyright (C) 2012-2014 JIOWA Business Solutions GmbH, Bettinastr. 30 , 60325 Frankfurt am Main, Germany
Homepage: www.jiowa.de
All rights reserved.
Download: www.jiowa.de/download.html
License: www.jiowa.de/license.html
Modifier and Type | Field and Description |
---|---|
protected SymbolToken |
ARBITRARY |
protected java.lang.Class<?> |
currentState
Start state for the state machine
|
protected java.lang.Class<?> |
finalState
End state for the state machine: null if there is none.
|
protected SymbolToken |
INCLUDE |
protected SymbolToken |
NAME_QUALIFIER |
protected SymbolToken |
OR |
protected SymbolToken |
REDEF_END |
protected SymbolToken |
REDEF_POINTER |
protected SymbolToken |
REDEF_SEPARATOR |
protected SymbolToken |
REDEF_START |
protected SymbolToken |
SUBTEMPLATE_END |
protected SymbolToken |
SUBTEMPLATE_INDICATOR |
protected SymbolToken |
SUBTEMPLATE_START |
protected SymbolToken |
TAG_END |
protected SymbolToken |
TAG_START |
protected TemplateNotation |
templateNotation
The given template notation
|
protected com.jiowa.util.map.Key2SortedValuesMap<java.lang.Class<?>,SymbolToken> |
transitions
Transition table
|
Constructor and Description |
---|
TokenStateMachine(java.lang.Class<?> initialState,
java.lang.Class<?> finalState,
TemplateNotation templateNotation) |
TokenStateMachine(TemplateNotation templateNotation) |
Modifier and Type | Method and Description |
---|---|
java.lang.Class<?> |
changeState(java.lang.Class<?> newState)
Change the state.
|
void |
changeTemplateNotation(TemplateNotation notation) |
java.lang.Class<?> |
getCurrentState()
Returns the current state.
|
java.util.SortedSet<java.lang.Class<?>> |
getTransitionStates(java.lang.Class<?> state)
Returns the possible transition states.
|
java.util.SortedSet<SymbolToken> |
getTransitionStatesAsTokens(java.lang.Class<?> state)
Returns the transition states as tokens according to the given template notation.
|
protected void |
initialize() |
protected java.lang.Class<?> currentState
protected java.lang.Class<?> finalState
protected com.jiowa.util.map.Key2SortedValuesMap<java.lang.Class<?>,SymbolToken> transitions
protected TemplateNotation templateNotation
protected SymbolToken TAG_START
protected SymbolToken TAG_END
protected SymbolToken INCLUDE
protected SymbolToken NAME_QUALIFIER
protected SymbolToken SUBTEMPLATE_START
protected SymbolToken SUBTEMPLATE_END
protected SymbolToken SUBTEMPLATE_INDICATOR
protected SymbolToken ARBITRARY
protected SymbolToken OR
protected SymbolToken REDEF_START
protected SymbolToken REDEF_POINTER
protected SymbolToken REDEF_SEPARATOR
protected SymbolToken REDEF_END
public TokenStateMachine(java.lang.Class<?> initialState, java.lang.Class<?> finalState, TemplateNotation templateNotation)
public TokenStateMachine(TemplateNotation templateNotation)
public void changeTemplateNotation(TemplateNotation notation)
public java.lang.Class<?> getCurrentState()
public java.util.SortedSet<SymbolToken> getTransitionStatesAsTokens(java.lang.Class<?> state)
TokenReader
.public java.util.SortedSet<java.lang.Class<?>> getTransitionStates(java.lang.Class<?> state)
state
- public java.lang.Class<?> changeState(java.lang.Class<?> newState)
TokenReader
and
the reader always knows in which state it is and which transition
can be executed.newState
- protected void initialize()