Class FSCatalog.CatalogContentHandler

  • All Implemented Interfaces:
    org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
    Enclosing class:
    FSCatalog

    private static class FSCatalog.CatalogContentHandler
    extends org.xml.sax.helpers.DefaultHandler
    A SAX ContentHandler that reads an XML catalog file and builds a Map of public IDs to local URIs. Currently only handles the element and attributes. To use, just call XMLReader.setContentHandler() with an instance of the class, parse, then call getEntityMap().
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​java.lang.String> entityMap  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.String> getEntityMap()
      Returns a Map of public Ids to local URIs
      void startElement​(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
      Receive notification of the beginning of an element; here used to pick up the mappings for public IDs to local URIs in the catalog.
      • Methods inherited from class org.xml.sax.helpers.DefaultHandler

        characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • entityMap

        private final java.util.Map<java.lang.String,​java.lang.String> entityMap
    • Constructor Detail

      • CatalogContentHandler

        public CatalogContentHandler()
    • Method Detail

      • getEntityMap

        public java.util.Map<java.lang.String,​java.lang.String> getEntityMap()
        Returns a Map of public Ids to local URIs
      • startElement

        public void startElement​(java.lang.String namespaceURI,
                                 java.lang.String localName,
                                 java.lang.String qName,
                                 org.xml.sax.Attributes atts)
        Receive notification of the beginning of an element; here used to pick up the mappings for public IDs to local URIs in the catalog.
        Specified by:
        startElement in interface org.xml.sax.ContentHandler
        Overrides:
        startElement in class org.xml.sax.helpers.DefaultHandler