|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.das2.dasml.DasMLValidator
public class DasMLValidator
A validator for the dasML language developed for the University of Iowa Space Plasma Wave Group. This class is used as a pre-processor to (hopefully) provide clear and helpful error messages. Warning: This class is not thread-safe. Unexpected results can occur if multiple threads use an instance of this class concurrently.
Field Summary | |
---|---|
static java.util.regex.Pattern |
FLOAT_PATTERN
|
static java.util.regex.Pattern |
INTEGER_PATTERN
|
static java.util.regex.Pattern |
WINDOW_POSITION_PATTERN
|
Constructor Summary | |
---|---|
DasMLValidator()
Creates a new instance of DasMLValidator |
Method Summary | |
---|---|
void |
endDocument()
Receive notification of the end of the document. |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
|
void |
error(org.xml.sax.SAXParseException e)
Receive notification of a recoverable parser error. |
void |
fatalError(org.xml.sax.SAXParseException e)
Report a fatal XML parsing error. |
org.xml.sax.SAXException |
getLastError()
Returns the last error encountered by this validator or null if no error has been found. |
static void |
main(java.lang.String[] args)
|
void |
setDocumentLocator(org.xml.sax.Locator locator)
Receive a Locator object for document events. |
void |
startDocument()
Receive notification of the beginning of the document. |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
Receive notification of the start of an element. |
boolean |
validate(org.xml.sax.InputSource source,
org.xml.sax.ErrorHandler errorHandler)
Parses and validates a dasML document. |
void |
warning(org.xml.sax.SAXParseException e)
Receive notification of a parser warning. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
characters, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.util.regex.Pattern INTEGER_PATTERN
public static java.util.regex.Pattern WINDOW_POSITION_PATTERN
public static java.util.regex.Pattern FLOAT_PATTERN
Constructor Detail |
---|
public DasMLValidator() throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
Method Detail |
---|
public boolean validate(org.xml.sax.InputSource source, org.xml.sax.ErrorHandler errorHandler) throws java.io.IOException
source
- The source of the XML documenterrorHandler
- The ErrorHandler instance that will receive
error messages from the parser. This can be null
IOException
- if the there is an error while reading the document.public org.xml.sax.SAXException getLastError()
public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
fatalError
in interface org.xml.sax.ErrorHandler
fatalError
in class org.xml.sax.helpers.DefaultHandler
e
- The error information encoded as an exception.
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.ErrorHandler.fatalError(org.xml.sax.SAXParseException)
,
SAXParseException
public void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator
in interface org.xml.sax.ContentHandler
setDocumentLocator
in class org.xml.sax.helpers.DefaultHandler
locator
- A locator for all SAX document events.ContentHandler.setDocumentLocator(org.xml.sax.Locator)
,
Locator
public void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
error
in interface org.xml.sax.ErrorHandler
error
in class org.xml.sax.helpers.DefaultHandler
e
- The warning information encoded as an exception.
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.ErrorHandler.warning(org.xml.sax.SAXParseException)
,
SAXParseException
public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
warning
in interface org.xml.sax.ErrorHandler
warning
in class org.xml.sax.helpers.DefaultHandler
e
- The warning information encoded as an exception.
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.ErrorHandler.warning(org.xml.sax.SAXParseException)
,
SAXParseException
public void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.startDocument()
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
qName
- The element type name.attributes
- The specified or defaulted attributes.
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.endDocument()
public static void main(java.lang.String[] args)
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |