org.apache.ivy.osgi.util

## Class DelegatingHandler

- java.lang.Object
- - org.xml.sax.helpers.DefaultHandler
  - - org.apache.ivy.osgi.util.DelegatingHandler

- All Implemented Interfaces:
    org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

      public class DelegatingHandler
      extends org.xml.sax.helpers.DefaultHandler
      implements org.xml.sax.DTDHandler, org.xml.sax.ContentHandler, org.xml.sax.ErrorHandler

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `DelegatingHandler.ChildElementHandler<DH extends DelegatingHandler>`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DelegatingHandler(java.lang.String name)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected <DH extends DelegatingHandler> void` | `addChild(DH saxHandler, DelegatingHandler.ChildElementHandler<DH> elementHandler)`
    `void` | `characters(char[] ch, int start, int length)`
    `protected void` | `doCharacters(char[] ch, int start, int length)`
    `protected void` | `doEndDocument()`
    `protected void` | `doEndElement(java.lang.String uri, java.lang.String localName, java.lang.String name)`
    `protected void` | `doEndPrefixMapping(java.lang.String prefix)`
    `protected void` | `doError(org.xml.sax.SAXParseException exception)`
    `protected void` | `doFatalError(org.xml.sax.SAXParseException exception)`
    `protected void` | `doIgnorableWhitespace(char[] ch, int start, int length)`
    `protected void` | `doNotationDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)`
    `protected void` | `doProcessingInstruction(java.lang.String target, java.lang.String data)`
    `protected void` | `doSkippedEntity(java.lang.String name)`
    `protected void` | `doStartDocument()`
    `protected void` | `doStartElement(java.lang.String uri, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes atts)`
    `protected void` | `doStartPrefixMapping(java.lang.String prefix, java.lang.String uri)`
    `protected void` | `doUnparsedEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String notationName)`
    `protected void` | `doWarning(org.xml.sax.SAXParseException exception)`
    `void` | `endDocument()`
    `void` | `endElement(java.lang.String uri, java.lang.String localName, java.lang.String n)`
    `void` | `endPrefixMapping(java.lang.String prefix)`
    `void` | `error(org.xml.sax.SAXParseException exception)`
    `void` | `fatalError(org.xml.sax.SAXParseException exception)`
    `java.lang.String` | `getBufferedChars()`
    `protected java.lang.String` | `getCurrentElementIdentifier()` Return an sort of identifier of the current element being parsed.
    `protected static java.lang.String` | `getLocation(org.xml.sax.Locator locator)`
    `org.xml.sax.Locator` | `getLocator()`
    `java.lang.String` | `getName()`
    `protected java.lang.String` | `getOptionalAttribute(org.xml.sax.Attributes atts, java.lang.String name, java.lang.String defaultValue)`
    `protected java.lang.Boolean` | `getOptionalBooleanAttribute(org.xml.sax.Attributes atts, java.lang.String name, java.lang.Boolean defaultValue)`
    `protected java.lang.Integer` | `getOptionalIntAttribute(org.xml.sax.Attributes atts, java.lang.String name, java.lang.Integer defaultValue)`
    `protected java.lang.Long` | `getOptionalLongAttribute(org.xml.sax.Attributes atts, java.lang.String name, java.lang.Long defaultValue)`
    `DelegatingHandler` | `getParent()`
    `protected java.lang.String` | `getRequiredAttribute(org.xml.sax.Attributes atts, java.lang.String name)`
    `protected boolean` | `getRequiredBooleanAttribute(org.xml.sax.Attributes atts, java.lang.String name)`
    `protected int` | `getRequiredIntAttribute(org.xml.sax.Attributes atts, java.lang.String name, java.lang.Integer logLevel)`
    `protected long` | `getRequiredLongAttribute(org.xml.sax.Attributes atts, java.lang.String name)`
    `protected void` | `handleAttributes(org.xml.sax.Attributes atts)` Called when the expected node is achieved
    `void` | `ignorableWhitespace(char[] ch, int start, int length)`
    `boolean` | `isBufferingChar()`
    `protected void` | `log(int logLevel, java.lang.String message)`
    `protected void` | `log(int logLevel, java.lang.String message, java.lang.Throwable t)`
    `void` | `notationDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)`
    `void` | `processingInstruction(java.lang.String target, java.lang.String data)`
    `void` | `setBufferingChar(boolean bufferingChar)`
    `void` | `setDocumentLocator(org.xml.sax.Locator locator)`
    `void` | `setSkipOnError(boolean skipOnError)`
    `void` | `skip()`
    `void` | `skippedEntity(java.lang.String name)`
    `void` | `startDocument()`
    `void` | `startElement(java.lang.String uri, java.lang.String localName, java.lang.String n, org.xml.sax.Attributes atts)`
    `void` | `startPrefixMapping(java.lang.String prefix, java.lang.String uri)`
    `protected void` | `stopDelegating()`
    `void` | `unparsedEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String notationName)`
    `void` | `warning(org.xml.sax.SAXParseException exception)`

    - ### Methods inherited from class org.xml.sax.helpers.DefaultHandler

      `resolveEntity`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DelegatingHandler

          public DelegatingHandler(java.lang.String name)

  - ### Method Detail

    - #### addChild

          protected <DH extends DelegatingHandler> void addChild(DH saxHandler,
                                                     DelegatingHandler.ChildElementHandler<DH> elementHandler)

    - #### getName

          public java.lang.String getName()

    - #### getParent

          public DelegatingHandler getParent()

    - #### setBufferingChar

          public void setBufferingChar(boolean bufferingChar)

    - #### setSkipOnError

          public void setSkipOnError(boolean skipOnError)

    - #### isBufferingChar

          public boolean isBufferingChar()

    - #### getBufferedChars

          public java.lang.String getBufferedChars()

    - #### setDocumentLocator

          public void setDocumentLocator(org.xml.sax.Locator locator)

      Specified by:
        `setDocumentLocator` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `setDocumentLocator` in class `org.xml.sax.helpers.DefaultHandler`

    - #### getLocator

          public org.xml.sax.Locator getLocator()

    - #### getCurrentElementIdentifier

          protected java.lang.String getCurrentElementIdentifier()

      Return an sort of identifier of the current element being parsed. It will only be used for logging purpose.
      Returns:
        an empty string by default

    - #### skip

          public void skip()

    - #### stopDelegating

          protected void stopDelegating()

    - #### startDocument

          public final void startDocument()
                                   throws org.xml.sax.SAXException

      Specified by:
        `startDocument` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `startDocument` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### doStartDocument

          protected void doStartDocument()
                                  throws org.xml.sax.SAXException

      Throws:
        `org.xml.sax.SAXException`

    - #### endDocument

          public final void endDocument()
                                 throws org.xml.sax.SAXException

      Specified by:
        `endDocument` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `endDocument` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### doEndDocument

          protected void doEndDocument()
                                throws org.xml.sax.SAXException

      Throws:
        `org.xml.sax.SAXException`

    - #### startElement

          public final void startElement(java.lang.String uri,
                          java.lang.String localName,
                          java.lang.String n,
                          org.xml.sax.Attributes atts)
                                  throws org.xml.sax.SAXException

      Specified by:
        `startElement` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `startElement` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### handleAttributes

          protected void handleAttributes(org.xml.sax.Attributes atts)
                                   throws org.xml.sax.SAXException

      Called when the expected node is achieved
      Parameters:
        `atts` - the xml attributes attached to the expected node
      Throws:
        `org.xml.sax.SAXException` - in case the parsing should be completely stopped

    - #### doStartElement

          protected void doStartElement(java.lang.String uri,
                            java.lang.String localName,
                            java.lang.String name,
                            org.xml.sax.Attributes atts)
                                 throws org.xml.sax.SAXException

      Throws:
        `org.xml.sax.SAXException`

    - #### endElement

          public final void endElement(java.lang.String uri,
                        java.lang.String localName,
                        java.lang.String n)
                                throws org.xml.sax.SAXException

      Specified by:
        `endElement` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `endElement` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### doEndElement

          protected void doEndElement(java.lang.String uri,
                          java.lang.String localName,
                          java.lang.String name)
                               throws org.xml.sax.SAXException

      Throws:
        `org.xml.sax.SAXException`

    - #### characters

          public final void characters(char[] ch,
                        int start,
                        int length)
                                throws org.xml.sax.SAXException

      Specified by:
        `characters` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `characters` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### doCharacters

          protected void doCharacters(char[] ch,
                          int start,
                          int length)
                               throws org.xml.sax.SAXException

      Throws:
        `org.xml.sax.SAXException`

    - #### startPrefixMapping

          public final void startPrefixMapping(java.lang.String prefix,
                                java.lang.String uri)
                                        throws org.xml.sax.SAXException

      Specified by:
        `startPrefixMapping` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `startPrefixMapping` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### doStartPrefixMapping

          protected void doStartPrefixMapping(java.lang.String prefix,
                                  java.lang.String uri)
                                       throws org.xml.sax.SAXException

      Throws:
        `org.xml.sax.SAXException`

    - #### endPrefixMapping

          public final void endPrefixMapping(java.lang.String prefix)
                                      throws org.xml.sax.SAXException

      Specified by:
        `endPrefixMapping` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `endPrefixMapping` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### doEndPrefixMapping

          protected void doEndPrefixMapping(java.lang.String prefix)
                                     throws org.xml.sax.SAXException

      Throws:
        `org.xml.sax.SAXException`

    - #### ignorableWhitespace

          public final void ignorableWhitespace(char[] ch,
                                 int start,
                                 int length)
                                         throws org.xml.sax.SAXException

      Specified by:
        `ignorableWhitespace` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `ignorableWhitespace` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### doIgnorableWhitespace

          protected void doIgnorableWhitespace(char[] ch,
                                   int start,
                                   int length)
                                        throws org.xml.sax.SAXException

      Throws:
        `org.xml.sax.SAXException`

    - #### notationDecl

          public final void notationDecl(java.lang.String name,
                          java.lang.String publicId,
                          java.lang.String systemId)
                                  throws org.xml.sax.SAXException

      Specified by:
        `notationDecl` in interface `org.xml.sax.DTDHandler`
      Overrides:
        `notationDecl` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### doNotationDecl

          protected void doNotationDecl(java.lang.String name,
                            java.lang.String publicId,
                            java.lang.String systemId)
                                 throws org.xml.sax.SAXException

      Throws:
        `org.xml.sax.SAXException`

    - #### processingInstruction

          public final void processingInstruction(java.lang.String target,
                                   java.lang.String data)
                                           throws org.xml.sax.SAXException

      Specified by:
        `processingInstruction` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `processingInstruction` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### doProcessingInstruction

          protected void doProcessingInstruction(java.lang.String target,
                                     java.lang.String data)
                                          throws org.xml.sax.SAXException

      Throws:
        `org.xml.sax.SAXException`

    - #### skippedEntity

          public final void skippedEntity(java.lang.String name)
                                   throws org.xml.sax.SAXException

      Specified by:
        `skippedEntity` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `skippedEntity` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### doSkippedEntity

          protected void doSkippedEntity(java.lang.String name)
                                  throws org.xml.sax.SAXException

      Throws:
        `org.xml.sax.SAXException`

    - #### unparsedEntityDecl

          public final void unparsedEntityDecl(java.lang.String name,
                                java.lang.String publicId,
                                java.lang.String systemId,
                                java.lang.String notationName)
                                        throws org.xml.sax.SAXException

      Specified by:
        `unparsedEntityDecl` in interface `org.xml.sax.DTDHandler`
      Overrides:
        `unparsedEntityDecl` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### doUnparsedEntityDecl

          protected void doUnparsedEntityDecl(java.lang.String name,
                                  java.lang.String publicId,
                                  java.lang.String systemId,
                                  java.lang.String notationName)
                                       throws org.xml.sax.SAXException

      Throws:
        `org.xml.sax.SAXException`

    - #### warning

          public final void warning(org.xml.sax.SAXParseException exception)
                             throws org.xml.sax.SAXException

      Specified by:
        `warning` in interface `org.xml.sax.ErrorHandler`
      Overrides:
        `warning` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### doWarning

          protected void doWarning(org.xml.sax.SAXParseException exception)
                            throws org.xml.sax.SAXException

      Throws:
        `org.xml.sax.SAXException`

    - #### error

          public final void error(org.xml.sax.SAXParseException exception)
                           throws org.xml.sax.SAXException

      Specified by:
        `error` in interface `org.xml.sax.ErrorHandler`
      Overrides:
        `error` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### doError

          protected void doError(org.xml.sax.SAXParseException exception)
                          throws org.xml.sax.SAXException

      Throws:
        `org.xml.sax.SAXException`

    - #### fatalError

          public final void fatalError(org.xml.sax.SAXParseException exception)
                                throws org.xml.sax.SAXException

      Specified by:
        `fatalError` in interface `org.xml.sax.ErrorHandler`
      Overrides:
        `fatalError` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### doFatalError

          protected void doFatalError(org.xml.sax.SAXParseException exception)
                               throws org.xml.sax.SAXException

      Throws:
        `org.xml.sax.SAXException`

    - #### log

          protected void log(int logLevel,
                 java.lang.String message,
                 java.lang.Throwable t)

    - #### log

          protected void log(int logLevel,
                 java.lang.String message)

    - #### getLocation

          protected static java.lang.String getLocation(org.xml.sax.Locator locator)

    - #### getRequiredAttribute

          protected java.lang.String getRequiredAttribute(org.xml.sax.Attributes atts,
                                              java.lang.String name)
                                                   throws org.xml.sax.SAXParseException

      Throws:
        `org.xml.sax.SAXParseException`

    - #### getOptionalAttribute

          protected java.lang.String getOptionalAttribute(org.xml.sax.Attributes atts,
                                              java.lang.String name,
                                              java.lang.String defaultValue)

    - #### getRequiredIntAttribute

          protected int getRequiredIntAttribute(org.xml.sax.Attributes atts,
                                    java.lang.String name,
                                    java.lang.Integer logLevel)
                                         throws org.xml.sax.SAXParseException

      Throws:
        `org.xml.sax.SAXParseException`

    - #### getOptionalIntAttribute

          protected java.lang.Integer getOptionalIntAttribute(org.xml.sax.Attributes atts,
                                                  java.lang.String name,
                                                  java.lang.Integer defaultValue)
                                                       throws org.xml.sax.SAXParseException

      Throws:
        `org.xml.sax.SAXParseException`

    - #### getRequiredLongAttribute

          protected long getRequiredLongAttribute(org.xml.sax.Attributes atts,
                                      java.lang.String name)
                                           throws org.xml.sax.SAXParseException

      Throws:
        `org.xml.sax.SAXParseException`

    - #### getOptionalLongAttribute

          protected java.lang.Long getOptionalLongAttribute(org.xml.sax.Attributes atts,
                                                java.lang.String name,
                                                java.lang.Long defaultValue)
                                                     throws org.xml.sax.SAXParseException

      Throws:
        `org.xml.sax.SAXParseException`

    - #### getRequiredBooleanAttribute

          protected boolean getRequiredBooleanAttribute(org.xml.sax.Attributes atts,
                                            java.lang.String name)
                                                 throws org.xml.sax.SAXParseException

      Throws:
        `org.xml.sax.SAXParseException`

    - #### getOptionalBooleanAttribute

          protected java.lang.Boolean getOptionalBooleanAttribute(org.xml.sax.Attributes atts,
                                                      java.lang.String name,
                                                      java.lang.Boolean defaultValue)
                                                           throws org.xml.sax.SAXParseException

      Throws:
        `org.xml.sax.SAXParseException`