Class XMLVersionParser

  • All Implemented Interfaces:
    MetaDataParser, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler

    public class XMLVersionParser
    extends XMLMetaDataParser
    Custom non-validating SAX parser which can be used to get the version and schema location attributes from the root node.
    Author:
    Jeremy Bauer
    • Constructor Detail

      • XMLVersionParser

        public XMLVersionParser​(java.lang.String rootElement)
    • Method Detail

      • endElement

        protected void endElement​(java.lang.String name)
                           throws org.xml.sax.SAXException
        Description copied from class: XMLMetaDataParser
        Override this method marking the end of some element.
        Specified by:
        endElement in class XMLMetaDataParser
        Throws:
        org.xml.sax.SAXException
      • startElement

        protected boolean startElement​(java.lang.String name,
                                       org.xml.sax.Attributes attrs)
                                throws org.xml.sax.SAXException
        Description copied from class: XMLMetaDataParser
        Override this method marking the start of some element. If this method returns false, the content of the element and the end element event will be ignored.
        Specified by:
        startElement in class XMLMetaDataParser
        Throws:
        org.xml.sax.SAXException
      • getVersion

        public java.lang.String getVersion()
        Get the string value of the version attribute on the root element
        Returns:
        doc version
      • getSchemaLocation

        public java.lang.String getSchemaLocation()
        Get the string value of the schema location attribute on the root element
        Returns:
        doc schema location