org.apache.xerces.impl.xs.models
Class XSDFACM
java.lang.Objectorg.apache.xerces.impl.xs.models.XSDFACM
- XSCMValidator
public class XSDFACM
extends java.lang.Object
DFAContentModel is the implementation of XSCMValidator that does
all of the non-trivial element content validation. This class does
the conversion from the regular expression to the DFA that
it then uses in its validation algorithm.
$Id: XSDFACM.java 573322 2007-09-06 16:48:47Z peterjm $
XSDFACM(CMNode syntaxTree, int leafCount)- Constructs a DFA content model.
|
XSDFACM
public XSDFACM(CMNode syntaxTree,
int leafCount) Constructs a DFA content model.
syntaxTree - The syntax tree of the content model.leafCount - The number of leaves.
endContentModel
public boolean endContentModel(int[] state)
The method indicates the end of list of children
- endContentModel in interface XSCMValidator
state - Current state of the content model
- true if the last state was a valid final state
isCompactedForUPA
public boolean isCompactedForUPA()
Checks if this content model has had its min/maxOccurs values reduced for
purposes of speeding up UPA. If so, this content model should not be used
for any purpose other than checking unique particle attribution
- isCompactedForUPA in interface XSCMValidator
- a boolean that says whether this content has been compacted for UPA
isFinalState
public boolean isFinalState(int state)
check whether the given state is one of the final states
state - the state to check
- whether it's a final state
oneTransition
public Object oneTransition(org.apache.xerces.xni.QName curElem,
int[] state,
SubstitutionGroupHandler subGroupHandler) one transition only
- oneTransition in interface XSCMValidator
curElem - The current element's QNamestate - stack to store the previous statesubGroupHandler - the substitution group handler
- null if transition is invalid; otherwise the Object corresponding to the
XSElementDecl or XSWildcardDecl identified. Also, the
state array will be modified to include the new state; this so that the validator can
store it away.
startContentModel
public int[] startContentModel()
This methods to be called on entering a first element whose type
has this content model. It will return the initial state of the content model
- startContentModel in interface XSCMValidator
- Start state of the content model
whatCanGoHere
public Vector whatCanGoHere(int[] state)
Check which elements are valid to appear at this point. This method also
works if the state is in error, in which case it returns what should
have been seen.
- whatCanGoHere in interface XSCMValidator
state - the current state
- a Vector whose entries are instances of
either XSWildcardDecl or XSElementDecl.
Copyright B) 1999-2007 The Apache Software Foundation. All Rights Reserved.