Package edu.isi.pegasus.planner.client
Class DAXValidator
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- edu.isi.pegasus.planner.client.DAXValidator
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler,org.xml.sax.DTDHandler,org.xml.sax.EntityResolver,org.xml.sax.ErrorHandler
public class DAXValidator extends org.xml.sax.helpers.DefaultHandlerThis class reads to validate a DAX document. It requires at least Xerces-J 2.10.
-
-
Field Summary
Fields Modifier and Type Field Description protected intm_errorsCounts the number of errors.protected intm_fatalsCounts the number of fatal errors.private org.xml.sax.Locatorm_locationKeep the location within the document.private org.xml.sax.XMLReaderm_readerHolds the instance of aXMLReaderclass.private java.lang.Stringm_schemafilewhat is the name of the schema file in the filename hint?protected booleanm_verboseHow verbose should we be?protected intm_warningsCounts the number of warnings.static java.lang.StringSCHEMA_NAMESPACEURI namespace for DAX schema.protected static java.lang.StringvendorParserClassDefault parser is the Xerces parser.
-
Constructor Summary
Constructors Constructor Description DAXValidator(boolean verbose)default c'tor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)voidendDocument()voidendElement(java.lang.String nsURI, java.lang.String localName, java.lang.String qName)voiderror(org.xml.sax.SAXParseException ex)voidfatalError(org.xml.sax.SAXParseException ex)private java.lang.Stringfull_where()voidignorableWhitespace(char[] ch, int start, int length)static voidmain(java.lang.String[] args)voidparse(java.lang.String filename)private booleanprop(java.lang.String uri, java.lang.Object value)Sets a SAX property while capturing failed features right here.private booleanset(java.lang.String uri, boolean flag)Sets a feature while capturing failed features right here.voidsetDocumentLocator(org.xml.sax.Locator locator)voidstartDocument()voidstartElement(java.lang.String nsURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs)booleanstatistics()Show how many warnings, errors and fatals were shown.voidwarning(org.xml.sax.SAXParseException ex)private java.lang.Stringwhere()
-
-
-
Field Detail
-
vendorParserClass
protected static final java.lang.String vendorParserClass
Default parser is the Xerces parser.- See Also:
- Constant Field Values
-
SCHEMA_NAMESPACE
public static final java.lang.String SCHEMA_NAMESPACE
URI namespace for DAX schema.- See Also:
- Constant Field Values
-
m_schemafile
private java.lang.String m_schemafile
what is the name of the schema file in the filename hint?
-
m_reader
private org.xml.sax.XMLReader m_reader
Holds the instance of aXMLReaderclass.
-
m_location
private org.xml.sax.Locator m_location
Keep the location within the document.
-
m_verbose
protected boolean m_verbose
How verbose should we be?
-
m_warnings
protected int m_warnings
Counts the number of warnings.
-
m_errors
protected int m_errors
Counts the number of errors.
-
m_fatals
protected int m_fatals
Counts the number of fatal errors.
-
-
Method Detail
-
set
private boolean set(java.lang.String uri, boolean flag)Sets a feature while capturing failed features right here.- Parameters:
uri- is the feature's URI to modifyflag- is the new value to set.- Returns:
- true, if the feature could be set, false for an exception
-
prop
private boolean prop(java.lang.String uri, java.lang.Object value)Sets a SAX property while capturing failed features right here.- Parameters:
uri- is the property's URI to modifyvalue- is the new value to set.- Returns:
- true, if the feature could be set, false for an exception
-
warning
public void warning(org.xml.sax.SAXParseException ex) throws org.xml.sax.SAXException- Specified by:
warningin interfaceorg.xml.sax.ErrorHandler- Overrides:
warningin classorg.xml.sax.helpers.DefaultHandler- Throws:
org.xml.sax.SAXException
-
error
public void error(org.xml.sax.SAXParseException ex) throws org.xml.sax.SAXException- Specified by:
errorin interfaceorg.xml.sax.ErrorHandler- Overrides:
errorin classorg.xml.sax.helpers.DefaultHandler- Throws:
org.xml.sax.SAXException
-
fatalError
public void fatalError(org.xml.sax.SAXParseException ex) throws org.xml.sax.SAXException- Specified by:
fatalErrorin interfaceorg.xml.sax.ErrorHandler- Overrides:
fatalErrorin classorg.xml.sax.helpers.DefaultHandler- Throws:
org.xml.sax.SAXException
-
setDocumentLocator
public void setDocumentLocator(org.xml.sax.Locator locator)
- Specified by:
setDocumentLocatorin interfaceorg.xml.sax.ContentHandler- Overrides:
setDocumentLocatorin classorg.xml.sax.helpers.DefaultHandler
-
full_where
private java.lang.String full_where()
-
where
private java.lang.String where()
-
startDocument
public void startDocument() throws org.xml.sax.SAXException- Specified by:
startDocumentin interfaceorg.xml.sax.ContentHandler- Overrides:
startDocumentin classorg.xml.sax.helpers.DefaultHandler- Throws:
org.xml.sax.SAXException
-
endDocument
public void endDocument()
- Specified by:
endDocumentin interfaceorg.xml.sax.ContentHandler- Overrides:
endDocumentin classorg.xml.sax.helpers.DefaultHandler
-
startElement
public void startElement(java.lang.String nsURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException- Specified by:
startElementin interfaceorg.xml.sax.ContentHandler- Overrides:
startElementin classorg.xml.sax.helpers.DefaultHandler- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String nsURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException- Specified by:
endElementin interfaceorg.xml.sax.ContentHandler- Overrides:
endElementin classorg.xml.sax.helpers.DefaultHandler- Throws:
org.xml.sax.SAXException
-
characters
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException- Specified by:
charactersin interfaceorg.xml.sax.ContentHandler- Overrides:
charactersin classorg.xml.sax.helpers.DefaultHandler- Throws:
org.xml.sax.SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException- Specified by:
ignorableWhitespacein interfaceorg.xml.sax.ContentHandler- Overrides:
ignorableWhitespacein classorg.xml.sax.helpers.DefaultHandler- Throws:
org.xml.sax.SAXException
-
parse
public void parse(java.lang.String filename) throws java.lang.Exception- Throws:
java.lang.Exception
-
statistics
public boolean statistics()
Show how many warnings, errors and fatals were shown.- Returns:
- true, if we should transmit an error exit code.
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
-