public class RelmesVerifier extends Object implements IVerifier
| Constructor and Description |
|---|
RelmesVerifier(DocumentDeclaration docDecl,
ErrorHandler handler) |
RelmesVerifier(IVerifier core) |
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
endDocument() |
void |
endElement(String namespaceURI,
String localName,
String qName) |
void |
endPrefixMapping(String prefix) |
Object |
getCurrentElementType()
returns current element type.
|
ErrorHandler |
getErrorHandler() |
org.relaxng.datatype.Datatype[] |
getLastCharacterType()
gets DataType that validated the last characters.
|
Locator |
getLocator() |
void |
ignorableWhitespace(char[] ch,
int start,
int length) |
boolean |
isValid()
checks if the document was valid.
|
void |
processingInstruction(String target,
String data) |
void |
setDocumentLocator(Locator locator) |
void |
setErrorHandler(ErrorHandler handler) |
void |
setPanicMode(boolean v)
Turns on/off the panic mode.
|
void |
skippedEntity(String name) |
void |
startDocument() |
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts) |
void |
startPrefixMapping(String prefix,
String uri) |
public RelmesVerifier(IVerifier core) throws ParserConfigurationException
ParserConfigurationExceptionpublic RelmesVerifier(DocumentDeclaration docDecl, ErrorHandler handler) throws ParserConfigurationException
ParserConfigurationExceptionpublic void setPanicMode(boolean v)
IVerifierHowever, 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,)
setPanicMode in interface IVerifierpublic boolean isValid()
IVerifierpublic Object getCurrentElementType()
IVerifiergetCurrentElementType in interface IVerifierpublic org.relaxng.datatype.Datatype[] getLastCharacterType()
IVerifierThis 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.
getLastCharacterType in interface IVerifierpublic final Locator getLocator()
getLocator in interface IVerifierpublic final ErrorHandler getErrorHandler()
getErrorHandler in interface IVerifierpublic final void setErrorHandler(ErrorHandler handler)
setErrorHandler in interface IVerifierpublic void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlerpublic void startDocument()
throws SAXException
startDocument in interface ContentHandlerSAXExceptionpublic void endDocument()
throws SAXException
endDocument in interface ContentHandlerSAXExceptionpublic void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping in interface ContentHandlerSAXExceptionpublic void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping in interface ContentHandlerSAXExceptionpublic void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
startElement in interface ContentHandlerSAXExceptionpublic void endElement(String namespaceURI, String localName, String qName) throws SAXException
endElement in interface ContentHandlerSAXExceptionpublic void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlerSAXExceptionpublic void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerSAXExceptionpublic void processingInstruction(String target, String data) throws SAXException
processingInstruction in interface ContentHandlerSAXExceptionpublic void skippedEntity(String name) throws SAXException
skippedEntity in interface ContentHandlerSAXExceptionMSV