Class ProxyContentHandler

  • All Implemented Interfaces:
    org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
    Direct Known Subclasses:
    XmlnsContentHandler

    public class ProxyContentHandler
    extends org.xml.sax.helpers.DefaultHandler
    A proxy content handler that passes all SAX events as-is to the proxied handler.

    As a convenience this class inherits the DefaultHandler class instead of just the ContentHandler interface. This makes it possible to use this class as an adapter when using methods like SAXParser.parse(String, DefaultHandler) that expect a DefaultHandler instance instead of a ContentHandler.

    • Constructor Summary

      Constructors 
      Constructor Description
      ProxyContentHandler​(org.xml.sax.ContentHandler handler)
      Creates a proxy for the given content handler.
    • Constructor Detail

      • ProxyContentHandler

        public ProxyContentHandler​(org.xml.sax.ContentHandler handler)
        Creates a proxy for the given content handler.
        Parameters:
        handler - content handler to be proxied
    • Method Detail

      • characters

        public void characters​(char[] ch,
                               int start,
                               int length)
                        throws org.xml.sax.SAXException
        Delegated to handler.
        Specified by:
        characters in interface org.xml.sax.ContentHandler
        Overrides:
        characters in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        ch - passed through
        start - passed through
        length - passed through
        Throws:
        org.xml.sax.SAXException - if an error occurs
      • endDocument

        public void endDocument()
                         throws org.xml.sax.SAXException
        Delegated to handler.
        Specified by:
        endDocument in interface org.xml.sax.ContentHandler
        Overrides:
        endDocument in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException - if an error occurs
      • endElement

        public void endElement​(java.lang.String namespaceURI,
                               java.lang.String localName,
                               java.lang.String qName)
                        throws org.xml.sax.SAXException
        Delegated to handler.
        Specified by:
        endElement in interface org.xml.sax.ContentHandler
        Overrides:
        endElement in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        namespaceURI - passed through
        localName - passed through
        qName - passed through
        Throws:
        org.xml.sax.SAXException - if an error occurs
      • endPrefixMapping

        public void endPrefixMapping​(java.lang.String prefix)
                              throws org.xml.sax.SAXException
        Delegated to handler.
        Specified by:
        endPrefixMapping in interface org.xml.sax.ContentHandler
        Overrides:
        endPrefixMapping in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        prefix - passed through
        Throws:
        org.xml.sax.SAXException - if an error occurs
      • ignorableWhitespace

        public void ignorableWhitespace​(char[] ch,
                                        int start,
                                        int length)
                                 throws org.xml.sax.SAXException
        Delegated to handler.
        Specified by:
        ignorableWhitespace in interface org.xml.sax.ContentHandler
        Overrides:
        ignorableWhitespace in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        ch - passed through
        start - passed through
        length - passed through
        Throws:
        org.xml.sax.SAXException - if an error occurs
      • processingInstruction

        public void processingInstruction​(java.lang.String target,
                                          java.lang.String data)
                                   throws org.xml.sax.SAXException
        Delegated to handler.
        Specified by:
        processingInstruction in interface org.xml.sax.ContentHandler
        Overrides:
        processingInstruction in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        target - passed through
        data - passed through
        Throws:
        org.xml.sax.SAXException - if an error occurs
      • setDocumentLocator

        public void setDocumentLocator​(org.xml.sax.Locator locator)
        Delegated to handler.
        Specified by:
        setDocumentLocator in interface org.xml.sax.ContentHandler
        Overrides:
        setDocumentLocator in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        locator - passed through
      • skippedEntity

        public void skippedEntity​(java.lang.String name)
                           throws org.xml.sax.SAXException
        Delegated to handler.
        Specified by:
        skippedEntity in interface org.xml.sax.ContentHandler
        Overrides:
        skippedEntity in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        name - passed through
        Throws:
        org.xml.sax.SAXException - if an error occurs
      • startDocument

        public void startDocument()
                           throws org.xml.sax.SAXException
        Delegated to handler.
        Specified by:
        startDocument in interface org.xml.sax.ContentHandler
        Overrides:
        startDocument in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException - if an error occurs
      • 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
        Delegated to handler.
        Specified by:
        startElement in interface org.xml.sax.ContentHandler
        Overrides:
        startElement in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        namespaceURI - passed through
        localName - passed through
        qName - passed through
        atts - passed through
        Throws:
        org.xml.sax.SAXException - if an error occurs
      • startPrefixMapping

        public void startPrefixMapping​(java.lang.String prefix,
                                       java.lang.String uri)
                                throws org.xml.sax.SAXException
        Delegated to handler.
        Specified by:
        startPrefixMapping in interface org.xml.sax.ContentHandler
        Overrides:
        startPrefixMapping in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        prefix - passed through
        uri - passed through
        Throws:
        org.xml.sax.SAXException - if an error occurs
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object