public abstract class AutomatonState extends java.lang.Object implements State
This class is designed for internal use only.
Modifier and Type | Field and Description |
---|---|
static Edge[] |
EMPTY_EDGE_ARRAY |
protected Edge[] |
wildcardEdges |
Constructor and Description |
---|
AutomatonState(FiniteStateMachine machine)
Create a new state
|
Modifier and Type | Method and Description |
---|---|
void |
addSpecificTransition(Edge edge,
SchemaCompiler compiler)
Add a specific transition from this state to another state.
|
void |
addWildcardTransition(SchemaCompiler compiler,
Edge transition)
Add a wildcard transition from this state to another state.
|
void |
display(java.util.HashMap<AutomatonState,java.lang.Integer> map)
Display the finite state machine reachable from this state.
|
void |
displayLambdaTransitions()
Display the lambda transitions available from this state
|
void |
displayState(Logger err)
Display the finite state machine reachable from this state.
|
java.util.Iterator<Edge> |
getEdges()
Get an iterator over all the transitions (edges) allowed from this state
|
Edge |
getMaxTransition()
Get the transition to be used when the maxOccurs value is reached for a counting state.
|
int |
getStateNumber()
Get the state number
|
Edge |
getTransition(int token,
UserComplexType type)
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 |
isConditionallyFinalState()
Test whether this state is a final state assuming the counter has reached its minimum value
|
boolean |
isFinalState()
Test whether this state is a final state
|
java.lang.CharSequence |
listAllowedElements()
List the allowed elements in this state as a string, for use in error messages
|
boolean |
requiresCounter()
Ask whether this is a counting state
|
void |
serialize(SchemaModelSerializer serializer)
Serialize this state as part of the serialization of a schema component model
|
void |
setFinalState(boolean finalState)
Set this state to be (or not to be) a final state
|
void |
setLimits(int min,
int max)
Set the counter limits
|
void |
setMaxTransition(Edge edge)
A counting state may have a special Edge that is used when the maxOccurs value is reached.
|
protected Edge[] wildcardEdges
public static final Edge[] EMPTY_EDGE_ARRAY
public AutomatonState(FiniteStateMachine machine)
machine
- the finite state machine to which this State belongspublic boolean isFinalState()
isFinalState
in interface State
public boolean isConditionallyFinalState()
public void setFinalState(boolean finalState)
finalState
- true if this state is finalpublic int getStateNumber()
public void addSpecificTransition(Edge edge, SchemaCompiler compiler) throws SchemaException
edge
- the transition to be addedcompiler
- the schema compilerSchemaException
- if there are two transitions for the same element
declaration, that is, if the content model is ambiguouspublic void addWildcardTransition(SchemaCompiler compiler, Edge transition) throws SchemaException
compiler
- the schema compilertransition
- the edge representing the transitionSchemaException
- if the transition cannot be added because
it would generate an inconsistencypublic void setLimits(int min, int max)
min
- the minimum number of occurrences of counting edges before a non-counting edge is usedmax
- the maximum number of occurrences of counting edges before a non-counting edge is used;
the value -1 means unboundedpublic boolean requiresCounter()
public Edge getTransition(int token, UserComplexType type)
getTransition
in interface State
token
- the input token, specifically the fingerprint of an element nametype
- the complex type we are validating againstpublic java.lang.CharSequence listAllowedElements()
listAllowedElements
in interface State
public Edge[] getWildcardEdges()
getWildcardEdges
in interface State
Edge
objects.public java.util.Iterator<Edge> getEdges()
public void display(java.util.HashMap<AutomatonState,java.lang.Integer> 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(Logger err)
err
- the output destination destinationpublic void displayLambdaTransitions()
public void setMaxTransition(Edge edge)
edge
- the transition to be used when the maxOccurs value is reachedpublic Edge getMaxTransition()
public void serialize(SchemaModelSerializer serializer) throws XPathException
serializer
- used to output the modelXPathException
- if any failure occursCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.