Class XCatalogReader

  • All Implemented Interfaces:
    CatalogReader, SAXCatalogParser, org.xml.sax.ContentHandler, org.xml.sax.DocumentHandler

    public class XCatalogReader
    extends SAXCatalogReader
    implements SAXCatalogParser
    Parse "xcatalog" XML Catalog files, this is the XML Catalog format developed by John Cowan and supported by Apache.
    Version:
    1.0
    See Also:
    Catalog
    • Field Detail

      • catalog

        protected Catalog catalog
        The catalog object needs to be stored by the object so that SAX callbacks can use it.
    • Constructor Detail

      • XCatalogReader

        public XCatalogReader​(javax.xml.parsers.SAXParserFactory parserFactory)
        The constructor
        Parameters:
        parserFactory -
    • Method Detail

      • getCatalog

        public Catalog getCatalog()
        Returns:
        the current catalog.
      • setDocumentLocator

        public void setDocumentLocator​(org.xml.sax.Locator locator)
        The SAX setDocumentLocator method does nothing.
        Specified by:
        setDocumentLocator in interface org.xml.sax.ContentHandler
        Specified by:
        setDocumentLocator in interface org.xml.sax.DocumentHandler
        Overrides:
        setDocumentLocator in class SAXCatalogReader
      • startDocument

        public void startDocument()
                           throws org.xml.sax.SAXException
        The SAX startDocument method does nothing.
        Specified by:
        startDocument in interface org.xml.sax.ContentHandler
        Specified by:
        startDocument in interface org.xml.sax.DocumentHandler
        Overrides:
        startDocument in class SAXCatalogReader
        Throws:
        org.xml.sax.SAXException
      • endDocument

        public void endDocument()
                         throws org.xml.sax.SAXException
        The SAX endDocument method does nothing.
        Specified by:
        endDocument in interface org.xml.sax.ContentHandler
        Specified by:
        endDocument in interface org.xml.sax.DocumentHandler
        Overrides:
        endDocument in class SAXCatalogReader
        Throws:
        org.xml.sax.SAXException
      • startElement

        public void startElement​(java.lang.String namespaceURI,
                                 java.lang.String localName,
                                 java.lang.String qName,
                                 org.xml.sax.Attributes atts)
                          throws org.xml.sax.SAXException
        The SAX startElement method recognizes elements from the plain catalog format and instantiates CatalogEntry objects for them.
        Specified by:
        startElement in interface org.xml.sax.ContentHandler
        Overrides:
        startElement in class SAXCatalogReader
        Parameters:
        namespaceURI - The namespace name of the element.
        localName - The local name of the element.
        qName - The QName of the element.
        atts - The list of attributes on the element.
        Throws:
        org.xml.sax.SAXException
        See Also:
        CatalogEntry
      • endElement

        public void endElement​(java.lang.String namespaceURI,
                               java.lang.String localName,
                               java.lang.String qName)
                        throws org.xml.sax.SAXException
        The SAX endElement method does nothing.
        Specified by:
        endElement in interface org.xml.sax.ContentHandler
        Overrides:
        endElement in class SAXCatalogReader
        Throws:
        org.xml.sax.SAXException
      • characters

        public void characters​(char[] ch,
                               int start,
                               int length)
                        throws org.xml.sax.SAXException
        The SAX characters method does nothing.
        Specified by:
        characters in interface org.xml.sax.ContentHandler
        Specified by:
        characters in interface org.xml.sax.DocumentHandler
        Overrides:
        characters in class SAXCatalogReader
        Throws:
        org.xml.sax.SAXException
      • ignorableWhitespace

        public void ignorableWhitespace​(char[] ch,
                                        int start,
                                        int length)
                                 throws org.xml.sax.SAXException
        The SAX ignorableWhitespace method does nothing.
        Specified by:
        ignorableWhitespace in interface org.xml.sax.ContentHandler
        Specified by:
        ignorableWhitespace in interface org.xml.sax.DocumentHandler
        Overrides:
        ignorableWhitespace in class SAXCatalogReader
        Throws:
        org.xml.sax.SAXException
      • processingInstruction

        public void processingInstruction​(java.lang.String target,
                                          java.lang.String data)
                                   throws org.xml.sax.SAXException
        The SAX processingInstruction method does nothing.
        Specified by:
        processingInstruction in interface org.xml.sax.ContentHandler
        Specified by:
        processingInstruction in interface org.xml.sax.DocumentHandler
        Overrides:
        processingInstruction in class SAXCatalogReader
        Throws:
        org.xml.sax.SAXException