org.apache.xerces.impl.xs.models
Class XSDFACM
java.lang.Object
org.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,v 1.13 2004/10/06 15:14:52 mrglavas Exp $
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
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-2005 Apache XML Project. All Rights Reserved.