public class Edge
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Edge.MaxOccursParticle |
static class |
Edge.MaxOccursTerm
Special singular Term identifying a transition to be used when the maxOccurs value of
a counting state is reached.
|
Modifier and Type | Field and Description |
---|---|
static Edge.MaxOccursParticle |
MAX_OCCURS_PARTICLE
Special singular Term identifying a transition to be used when the maxOccurs value of
a counting state is reached.
|
Constructor and Description |
---|
Edge() |
Modifier and Type | Method and Description |
---|---|
Particle |
getParticle()
Get the element or wildcard particle causing this transition
|
AutomatonState |
getTargetState()
Get the (fixed) state that is the target of this edge
|
Term |
getTerm()
Get the element or wildcard particle causing this transition
|
State |
makeTransition(State previousState)
Get the dynamic state that results from a transition using this edge,
updating any counters that need to be updated
|
java.lang.String |
matches(Edge de,
SchemaCompiler compiler)
Test whether edges in two different finite state machines match each other.
|
void |
serialize(SchemaModelSerializer serializer)
Serialize this Edge as part of the serialization of a schema component model
|
void |
setParticle(Particle particle)
Set the element or wildcard particle causing this transition
|
void |
setTargetState(AutomatonState targetState)
Set the state resulting from this transition
|
void |
setTerm(Term term)
Set the element or wildcard particle causing this transition
|
public static final Edge.MaxOccursParticle MAX_OCCURS_PARTICLE
public void setTargetState(AutomatonState targetState)
targetState
- the state at the end of this edgepublic AutomatonState getTargetState()
public State makeTransition(State previousState) throws ValidationException
previousState
- the previous dynamic state before making this transitionValidationException
- if this transition is not possible because the occurrence limits are violatedpublic void setTerm(Term term)
term
- the term that causes this transitionpublic Term getTerm()
public void setParticle(Particle particle)
particle
- the particle that causes this transitionpublic Particle getParticle()
public java.lang.String matches(Edge de, SchemaCompiler compiler) throws MissingComponentException
From Thompson & Tobin 2003: an edge BE matches another edge DE iff one of the following three conditions holds: (1) they are labelled as element declarations with the same expanded name; (2) BE is labelled with a wildcard and DE is labelled with an element declaration in a namespace allowed by the wildcard; (3) BE and DE are both wildcards and DE's label is an intensional subset of BE's. In case (3) we add the rule, not in Thompson and Tobin, that the processContents of DE must be at least as strong as the processContents of BE.
It is also necessary that the types of B and D are compatible, and that their nillability is compatible, and that their value constraints are compatible, and that the disallowed substitutions of D is a superset of those of B.
de
- the edge in a finite state machine representing a derived type, and which corresponds
to this edge in the finite state machine for the base typecompiler
- user for error reportingMissingComponentException
public void serialize(SchemaModelSerializer serializer) throws XPathException
serializer
- object that formats the model outputXPathException
- if a serialization error occurCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.