|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
XMLValidator defines the interface that XMLDocumentScanner and XML EntityHandler have with an object that serves as a pluggable validator. This abstraction allows validators for XML grammar languages to be plugged in and queried for validity checks as the scanner processes a document. The document scanner and entity handler need to ask the validator object for this information because the validator object is responsible for reading the grammar specification file (which contains markup declarations and entity declarations)
Inner Class Summary | |
static interface |
XMLValidator.ContentSpec
ContentSpec really exists to aid the parser classes in implementing access to the grammar |
Method Summary | |
boolean |
attributeSpecified(int elementType,
XMLAttrList attrList,
int attrName,
Locator attrNameLocator,
int attValue)
add an attribute definition for an attribute name attrName to the element elementType. |
void |
characters(char[] chars,
int offset,
int length)
a callback for character data - String object version |
void |
characters(int stringIndex)
a callback for character data - string pool version |
int |
checkContent(int elementHandle,
int childCount,
int[] children)
validate an element's content |
boolean |
endElement(int elementType)
a callback for the end tag of an element |
boolean |
externalReferenceInContent(int entityIndex)
return true if entityIndex's entity is external, and it satisfies the requirements for an external entity reference within content |
java.lang.String |
getContentSpecAsString(int elementIndex)
return elementIndex's content spec as a string |
int |
getEntityValue(int entityIndex)
return the replacement text for entityIndex |
int |
getParameterEntityValue(int peIndex)
return the replacement text for a parameter entity |
java.lang.String |
getPublicIdOfEntity(int entityIndex)
return the public identifer for entityIndex |
java.lang.String |
getPublicIdOfParameterEntity(int peIndex)
return the public identifier for a parameter entity |
java.lang.String |
getSystemIdOfEntity(int entityIndex)
return the system identifier for entityIndex |
java.lang.String |
getSystemIdOfParameterEntity(int peIndex)
return the system identifier for a parameter entity |
void |
ignorableWhitespace(char[] chars,
int offset,
int length)
a callback for ignorable whitespace - String object version |
void |
ignorableWhitespace(int stringIndex)
a callback for ignorable whitespace - string pool version |
boolean |
isExternalEntity(int entityIndex)
return true if entityIndex's entity is external |
boolean |
isExternalParameterEntity(int peIndex)
return true if a parameter entity is external |
boolean |
isUnparsedEntity(int entityIndex)
return true if entityIndex's entity is unparsed |
int |
lookupEntity(int entityName)
return a handle to an entity. |
int |
lookupParameterEntity(int peName)
return a handle to a parameter entity - this handle can then be passed to other XMLEntityHandler methods on XMLValidator |
void |
rootElementSpecified(int rootElementType)
Check to see if the rootElement matches the root element specified by the DOCTYPE line. |
boolean |
startElement(int elementType,
XMLAttrList attrList)
a callback for the start tag of an element |
int |
valueOfReferenceInAttValue(int entityIndex)
return the string pool index of an entity the entity must be allowed to appear in an attribute value |
Method Detail |
public void rootElementSpecified(int rootElementType) throws java.lang.Exception
rootElementType
- StringPool handle for the rootElementpublic boolean attributeSpecified(int elementType, XMLAttrList attrList, int attrName, Locator attrNameLocator, int attValue) throws java.lang.Exception
elementType
- the index of the elementattrList
- the XMLAttrList to receive the new attributeattrName
- the string pool index of the attribute nameattrNameLocator
- a SAX Locator (for error reporting)attValue
- the string pool index of the attribute valuepublic boolean startElement(int elementType, XMLAttrList attrList) throws java.lang.Exception
elementType
- the index of the elementattrList
- the XMLAttrList containing the attributes for the elementpublic boolean endElement(int elementType) throws java.lang.Exception
elementType
- the index of the elementpublic void characters(char[] chars, int offset, int length) throws java.lang.Exception
chars
- array containing the characters that were scannedoffset
- offset in chars of characters that were scannedlength
- length of characters that were scannedpublic void characters(int stringIndex) throws java.lang.Exception
stringIndex
- string pool index of the string that was scannedpublic void ignorableWhitespace(char[] chars, int offset, int length) throws java.lang.Exception
chars
- array containing the white space that was scannedoffset
- offset in chars of the white space that was scannedlength
- length of the white space that was scannedpublic void ignorableWhitespace(int stringIndex) throws java.lang.Exception
stringIndex
- - string pool index of the white space that was scannedpublic boolean externalReferenceInContent(int entityIndex) throws java.lang.Exception
entityIndex
- entity handlepublic int valueOfReferenceInAttValue(int entityIndex) throws java.lang.Exception
entityIndex
- entity handlepublic int lookupEntity(int entityName) throws java.lang.Exception
entityName
- string pool index of entity namepublic boolean isUnparsedEntity(int entityIndex) throws java.lang.Exception
entityIndex
- entity handlepublic boolean isExternalEntity(int entityIndex) throws java.lang.Exception
entityIndex
- entity handlepublic int getEntityValue(int entityIndex) throws java.lang.Exception
entityIndex
- entity handlepublic java.lang.String getPublicIdOfEntity(int entityIndex) throws java.lang.Exception
entityIndex
- entity handlepublic java.lang.String getSystemIdOfEntity(int entityIndex) throws java.lang.Exception
entityIndex
- entity handlepublic int lookupParameterEntity(int peName) throws java.lang.Exception
peName
- string pool index of a parameter entity namepublic boolean isExternalParameterEntity(int peIndex) throws java.lang.Exception
peIndex
- parameter entity handlepublic int getParameterEntityValue(int peIndex) throws java.lang.Exception
peIndex
- parameter entity handlepublic java.lang.String getPublicIdOfParameterEntity(int peIndex) throws java.lang.Exception
peIndex
- parameter entity handlepublic java.lang.String getSystemIdOfParameterEntity(int peIndex) throws java.lang.Exception
peIndex
- parameter entity handlepublic int checkContent(int elementHandle, int childCount, int[] children) throws java.lang.Exception
elementHandle
- handle of the element to be validatedchildCount
- the number of children to be checkedchildren
- an array containing the indices of the children to be checkedpublic java.lang.String getContentSpecAsString(int elementIndex)
elementIndex
- element handle
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |