|
XML for Java 2.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This class defines the interface between the scanner and a validator. As the scanner scans the XML content, it will call these methods to validate the data as it goes. It is assumed that the implementation of the interface will use the provided XMLParser object to gain access to the element declaration and string pools required to interpret the passed element and attribute indexes.
XMLParser
Method Summary | |
void |
checkAttributes(int elementIndex,
int firstAttrIndex)
Check that the attributes for an element are valid. |
int |
checkContent(int elementIndex,
int childCount,
int[] children)
Check that the content of an element is valid. |
void |
checkIDRefNames()
Check that all ID references were to ID attributes present in the document. |
void |
checkRootElementName(int elementNameIndex)
Check that the root element name is valid. |
void |
reset(ParserState parserState)
Reset the handler. |
int |
whatCanGoHere(int elementIndex,
boolean fullyValid,
InsertableElementsInfo info)
Returns information about which elements can be placed at a particular point in the passed element's content model. |
Method Detail |
public void reset(ParserState parserState)
parserState
- The parser state to use for the next parse call.public void checkRootElementName(int elementNameIndex) throws java.lang.Exception
elementNameIndex
- The index within the StringPool
of the
root element name.public void checkAttributes(int elementIndex, int firstAttrIndex) throws java.lang.Exception
elementIndex
- The index within the ElementDeclPool
of
this element.firstAttrIndex
- The index within the AttrPool
of the
first attribute of this element, or -1 if there are
no attributes.public int checkContent(int elementIndex, int childCount, int[] children) throws java.lang.Exception
elementIndex
- The index within the ElementDeclPool
of this
element.childCount
- The number of entries in the children
array.children
- The children of this element. Each integer is an index within
the StringPool
of the child element name. An index
of -1 is used to indicate an occurrence of non-whitespace character
data.public void checkIDRefNames() throws java.lang.Exception
public int whatCanGoHere(int elementIndex, boolean fullyValid, InsertableElementsInfo info) throws java.lang.Exception
elementIndex
- The index within the ElementDeclPool
of the
element which is being querying.fullyValid
- Only return elements that can be inserted and still
maintain the validity of subsequent elements past the
insertion point (if any). If the insertion point is at
the end, and this is true, then only elements that can
be legal final states will be returned.info
- An object that contains the required input data for the method,
and which will contain the output information if successful.
|
XML for Java 2.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |