|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.saxonica.fsa.AutomatonState
public abstract class AutomatonState
Defines a state of a finite state machine used when validating an instance against a complex type. Each State knows about the possible transitions to other states, and knows whether it is a final state. The initial state is referenced from the FiniteStateMachine object, which is itself a property of the UserComplexType against which validation is being performed.
This class is designed for internal use only.
Field Summary | |
---|---|
static Edge[] |
EMPTY_EDGE_ARRAY
|
Constructor Summary | |
---|---|
AutomatonState(FiniteStateMachine machine)
Create a new state |
Method Summary | |
---|---|
void |
addWildcardTransition(Edge transition)
Add a wildcard transition from this state to another state. |
void |
display(HashMap map)
Display the finite state machine reachable from this state. |
void |
displayLambdaTransitions()
|
void |
displayState()
Display the finite state machine reachable from this state. |
Iterator |
getEdges()
Get an iterator over all the transitions (edges) allowed from this state |
Edge |
getSpecificTransition(int token)
Get a specific transition if there is one |
Edge |
getTransition(int token,
NamePool pool)
Find the edge representing the transition from this state to another state, that is triggered by a given input token |
Edge[] |
getWildcardEdges()
Get an iterator over the wildcard transitions (edges) allowed from this state. |
boolean |
isFinalState()
Test whether this state is a final state |
CharSequence |
listAllowedElements()
List the allowed elements in this state as a string, for use in error messages |
void |
setFinalState(boolean finalState)
Set this state to be (or not to be) a final state |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Edge[] EMPTY_EDGE_ARRAY
Constructor Detail |
---|
public AutomatonState(FiniteStateMachine machine)
machine
- Method Detail |
---|
public boolean isFinalState()
public void setFinalState(boolean finalState)
finalState
- true if this state is finalpublic void addWildcardTransition(Edge transition) throws SchemaException
transition
- the edge representing the transition
SchemaException
public Edge getTransition(int token, NamePool pool)
token
- the input token, specifically the fingerprint of an element name
public Edge getSpecificTransition(int token)
public CharSequence listAllowedElements()
public Edge[] getWildcardEdges()
Edge
objects.public Iterator getEdges()
Edge
objects.public void display(HashMap map)
map
- a Hashmap mapping states already processed to the integer values used to represent that state.
The method should be called initially with an empty map.public void displayState()
public void displayLambdaTransitions()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |