| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final DatatypeRef | attributeType
the same instance is reused by the feedAttribute method to reduce the number of the object creation. |
| private final DatatypeRef | characterType
this field is used to receive type information of character literals. |
| protected Acceptor | |
| private static final int | |
| protected final DocumentDeclaration | docDecl
Schema object against which the validation will be done |
| private Set | duplicateIds
Stores all duplicate id values. |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| protected ErrorHandler | errorHandler
Error handler |
| protected boolean | hadError
This flag will be set to true if an error is found |
| private int | initialPanicLevel
Initial panic level when an error is found. |
| private boolean | isFinished
This flag will be set to true after endDocument method is called. |
| protected int | panicLevel
Panic level. |
| pack-priv Verifier. | stack
context stack |
| private final StartTagInfo | sti
An object used to store start tag information. |
| private int | stringCareLevel
current string care level. |
| private StringBuffer | text
characters that were read (but not processed) |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | characters(char[]
the characters from the XML document buf, int the start position in the array start, int the number of characters to read from the array len)Implements org. |
| public void | endDocument()
Implements org. |
| public void | endElement(String
the Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed namespaceUri, String the local name (without prefix), or the
empty string if Namespace processing is not being
performed localName, String the qualified XML name (with prefix), or the
empty string if qualified names are not available qName)Overrides com. Implements org. |
| protected Datatype[] | |
| public Object | getCurrentElementType()
Implements com. |
| public final ErrorHandler | |
| public Datatype[] | getLastCharacterType()
Implements com. |
| public void | ignorableWhitespace(char[]
the characters from the XML document buf, int the start position in the array start, int the number of characters to read from the array len)Implements org. |
| protected void | |
| public final boolean | |
| public static String | |
| public void | onDuplicateId(String id)
Implements abstract com. |
| protected ValidityViolation | |
| protected ValidityViolation | |
| protected void | onNextAcceptorReady(StartTagInfo sti, Acceptor nextAcceptor)
this method is called from the startElement method after the tag name is processed and the child acceptor is created. |
| public final void | |
| public final void | setPanicMode(boolean usePanicMode)
Implements com. |
| public void | startDocument()
Implements org. |
| public void | startElement(String
the Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed namespaceUri, String the local name (without prefix), or the
empty string if Namespace processing is not being
performed localName, String the qualified name (with prefix), or the
empty string if qualified names are not available qName, Attributes the attributes attached to the element. If
there are no attributes, it shall be an empty
Attributes object. The value of this object after
startElement returns is undefined atts)Overrides com. Implements org. |
| protected void |
| attributeType | back to summary |
|---|---|
| private final DatatypeRef attributeType the same instance is reused by the feedAttribute method to reduce the number of the object creation. | |
| characterType | back to summary |
|---|---|
| private final DatatypeRef characterType this field is used to receive type information of character literals. | |
| current | back to summary |
|---|---|
| protected Acceptor current | |
| DEFAULT_PANIC_LEVEL | back to summary |
|---|---|
| private static final int DEFAULT_PANIC_LEVEL | |
| docDecl | back to summary |
|---|---|
| protected final DocumentDeclaration docDecl Schema object against which the validation will be done | |
| duplicateIds | back to summary |
|---|---|
| private Set<String> duplicateIds Stores all duplicate id values. Errors are reported at the endDocument method because the onDuplicateId method cannot throw an exception. | |
| ERR_DUPLICATE_ID | back to summary |
|---|---|
| public static final String ERR_DUPLICATE_ID | |
| ERR_MISSING_ATTRIBUTE | back to summary |
|---|---|
| public static final String ERR_MISSING_ATTRIBUTE | |
| ERR_UNCOMPLETED_CONTENT | back to summary |
|---|---|
| public static final String ERR_UNCOMPLETED_CONTENT | |
| ERR_UNEXPECTED_ATTRIBUTE | back to summary |
|---|---|
| public static final String ERR_UNEXPECTED_ATTRIBUTE | |
| ERR_UNEXPECTED_ELEMENT | back to summary |
|---|---|
| public static final String ERR_UNEXPECTED_ELEMENT | |
| ERR_UNEXPECTED_STARTTAG | back to summary |
|---|---|
| public static final String ERR_UNEXPECTED_STARTTAG | |
| ERR_UNEXPECTED_TEXT | back to summary |
|---|---|
| public static final String ERR_UNEXPECTED_TEXT | |
| ERR_UNSOLD_IDREF | back to summary |
|---|---|
| public static final String ERR_UNSOLD_IDREF | |
| errorHandler | back to summary |
|---|---|
| protected ErrorHandler errorHandler Error handler | |
| hadError | back to summary |
|---|---|
| protected boolean hadError This flag will be set to true if an error is found | |
| initialPanicLevel | back to summary |
|---|---|
| private int initialPanicLevel Initial panic level when an error is found. If this value is bigger, MSV will take more time to recover from errors, Setting this value to 0 means turning the panic mode off entirely. | |
| isFinished | back to summary |
|---|---|
| private boolean isFinished This flag will be set to true after endDocument method is called. | |
| panicLevel | back to summary |
|---|---|
| protected int panicLevel Panic level. If the level is non-zero, createChildAcceptors will silently recover from error. This effectively suppresses spurious error messages. This value is set to INITIAL_PANIC_LEVEL when first an error is encountered, and is decreased by successful stepForward and createChildAcceptor. This value is also propagated to child acceptors. | |
| stack | back to summary |
|---|---|
| pack-priv Verifier. context stack | |
| sti | back to summary |
|---|---|
| private final StartTagInfo sti An object used to store start tag information. the same object is reused. | |
| stringCareLevel | back to summary |
|---|---|
| private int stringCareLevel current string care level. See Acceptor.getStringCareLevel | |
| text | back to summary |
|---|---|
| private StringBuffer text characters that were read (but not processed) | |
| Verifier | back to summary |
|---|---|
| public Verifier(DocumentDeclaration documentDecl, ErrorHandler errorHandler) | |
| characters | back to summary |
|---|---|
| public void characters(char[] buf, int start, int len) throws SAXException Implements org. Doc from org. Receive notification of character data. The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information. The application must not attempt to read from the array outside of the specified range. Individual characters may consist of more than one Java
Your code should not assume that algorithms using
Note that some parsers will report whitespace in element
content using the
| |
| endDocument | back to summary |
|---|---|
| public void endDocument() throws SAXException Implements org. Doc from org. Receive notification of the end of a document. This method is invoked by the parser to signal it has reached the end of the document after successfully completing the parsing process. After the event, the parser will return the control to the application.
| |
| endElement | back to summary |
|---|---|
| public void endElement(String namespaceUri, String localName, String qName) throws SAXException Overrides com. Implements org. Doc from org. Receive notification of the end of an element. The SAX parser will invoke this method at the end of every
element in the XML document; there will be a corresponding
For information on the names, see startElement.
| |
| feedAttribute | back to summary |
|---|---|
| protected Datatype[] feedAttribute(Acceptor child, String uri, String localName, String qName, String value) throws SAXException | |
| getCurrentElementType | back to summary |
|---|---|
| public Object getCurrentElementType() Implements com. Doc from com. returns current element type. Actual java type depends on the implementation. This method works correctly only when called immediately after handling startElement event.
| |
| getErrorHandler | back to summary |
|---|---|
| public final ErrorHandler getErrorHandler() Implements com. | |
| getLastCharacterType | back to summary |
|---|---|
| public Datatype[] getLastCharacterType() Implements com. Doc from com. gets DataType that validated the last characters. This method works correctly only when called immediately after startElement and endElement method. When called, this method returns DataType object that validated the last character literals. For RELAX NG grammar, this method can return an array of length 2 or more. This happens when the last character matches <list> pattern. In that case, each type corresponds to each token (where tokens are the white-space separation of the last characters). For any other grammar, this method always returns an array of length 1 (or null, if the type assignment failed). So when you are using VerifierFilter, you can call this method only in your startElement and endElement method.
| |
| ignorableWhitespace | back to summary |
|---|---|
| public void ignorableWhitespace(char[] buf, int start, int len) throws SAXException Implements org. Doc from org. Receive notification of ignorable whitespace in element content. Validating Parsers must use this method to report each chunk of whitespace in element content (see the W3C XML 1.0 recommendation, section 2.10): non-validating parsers may also use this method if they are capable of parsing and using content models. SAX parsers may return all contiguous whitespace in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity, so that the Locator provides useful information. The application must not attempt to read from the array outside of the specified range.
| |
| init | back to summary |
|---|---|
| protected void init() Overrides com. | |
| isValid | back to summary |
|---|---|
| public final boolean isValid() Implements com. Doc from com. checks if the document was valid. This method may not be called before verification was completed.
| |
| localizeMessage | back to summary |
|---|---|
| public static String localizeMessage(String propertyName, Object[] args) | |
| onDuplicateId | back to summary |
|---|---|
| public void onDuplicateId(String id) Implements abstract com. Doc from com. this method is called when a duplicate id value is found. | |
| onError | back to summary |
|---|---|
| protected ValidityViolation onError(StringRef ref, String defaultMsg, ErrorInfo ei) throws SAXException signals an error. This method can be overrided by the derived class to provide different behavior. | |
| onError | back to summary |
|---|---|
| protected ValidityViolation onError(String msg, ErrorInfo ei) throws SAXException | |
| onNextAcceptorReady | back to summary |
|---|---|
| protected void onNextAcceptorReady(StartTagInfo sti, Acceptor nextAcceptor) throws SAXException this method is called from the startElement method after the tag name is processed and the child acceptor is created. This method is called before the attributes are consumed. derived class can use this method to do something useful. | |
| setErrorHandler | back to summary |
|---|---|
| public final void setErrorHandler(ErrorHandler handler) Implements com. | |
| setPanicMode | back to summary |
|---|---|
| public final void setPanicMode(boolean usePanicMode) Implements com. Doc from com. Turns on/off the panic mode. Panic mode is on by default. Turning it on is good for general use. It prevents false error messages to appear. However, turning it off is sometimes useful, when you are sure that the structure of the document is almost valid (e.g., validating a document generated by an application or when you are sure about the validity of the structure and only interested in validating datatypes,) | |
| startDocument | back to summary |
|---|---|
| public void startDocument() throws SAXException Implements org. Doc from org. Receive notification of the beginning of a document. The SAX parser will invoke this method only once, before any
other event callbacks (except for
| |
| startElement | back to summary |
|---|---|
| public void startElement(String namespaceUri, String localName, String qName, Attributes atts) throws SAXException Overrides com. Implements org. Doc from org. Receive notification of the beginning of an element. The Parser will invoke this method at the beginning of every
element in the XML document; there will be a corresponding
This event allows up to three name components for each element:
Any or all of these may be provided, depending on the values of the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes properties:
Note that the attribute list provided will contain only
attributes with explicit values (specified or defaulted):
#IMPLIED attributes will be omitted. The attribute list
will contain attributes used for Namespace declarations
(xmlns* attributes) only if the
Like
| |
| verifyText | back to summary |
|---|---|
| protected void verifyText() throws SAXException | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Acceptor | |
| pack-priv int | |
| pack-priv final Verifier. | |
| pack-priv final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| acceptor | back to summary |
|---|---|
| pack-priv final Acceptor acceptor | |
| panicLevel | back to summary |
|---|---|
| pack-priv int panicLevel | |
| previous | back to summary |
|---|---|
| pack-priv final Verifier. | |
| stringCareLevel | back to summary |
|---|---|
| pack-priv final int stringCareLevel | |
| Context | back to summary |
|---|---|
| pack-priv Context(Verifier. | |