Package org.apache.cayenne.configuration.xml

## Class NamespaceAwareNestedTagHandler

- java.lang.Object
- - org.xml.sax.helpers.DefaultHandler
  - - org.apache.cayenne.configuration.xml.SAXNestedTagHandler
    - - org.apache.cayenne.configuration.xml.NamespaceAwareNestedTagHandler

- All Implemented Interfaces:
    `ContentHandler`, `DTDHandler`, `EntityResolver`, `ErrorHandler`
  Direct Known Subclasses:
    `DataMapHandler`, `DbEntityHandler`, `DbKeyGeneratorHandler`, `DbRelationshipHandler`, `EmbeddableAttributeHandler`, `EmbeddableHandler`, `ObjEntityHandler`, `ObjRelationshipHandler`, `ProcedureHandler`, `QueryDescriptorHandler`, `VersionAwareHandler`

      public abstract class NamespaceAwareNestedTagHandler
      extends SAXNestedTagHandler

  Base class for handlers that can delegate execution of unknown tags to handlers produced by factory.
  Since:
    4.1

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected boolean` | `allowAllNamespaces` |
    `protected String` | `targetNamespace` |

    - ### Fields inherited from class org.apache.cayenne.configuration.xml.SAXNestedTagHandler

      `loaderContext, locator, parentHandler`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `NamespaceAwareNestedTagHandler​(LoaderContext loaderContext)` |
    `NamespaceAwareNestedTagHandler​(NamespaceAwareNestedTagHandler parentHandler)` |
    `NamespaceAwareNestedTagHandler​(SAXNestedTagHandler parentHandler, String targetNamespace)` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `characters​(char[] ch, int start, int length)` |
    `protected ContentHandler` | `createChildTagHandler​(String namespaceURI, String localName, String qName, Attributes attributes)` | This method should be used to create nested handlers to process children elements.
    `void` | `endElement​(String namespaceURI, String localName, String qName)` |
    `protected void` | `processCharData​(String localName, String data)` |
    `protected abstract boolean` | `processElement​(String namespaceURI, String localName, Attributes attributes)` | Main method to process XML content.
    `void` | `setAllowAllNamespaces​(boolean allowAllNamespaces)` |
    `void` | `setTargetNamespace​(String targetNamespace)` |
    `void` | `startElement​(String namespaceURI, String localName, String qName, Attributes attributes)` | This method directly called by SAX parser, do not override it directly, use `SAXNestedTagHandler.processElement(String, String, Attributes)` method instead to process content.

    - ### Methods inherited from class org.apache.cayenne.configuration.xml.SAXNestedTagHandler

      `beforeScopeEnd, getParentHandler, setDocumentLocator, stop, unexpectedTagMessage`

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

      `endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, 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

    - #### targetNamespace

          protected String targetNamespace

    - #### allowAllNamespaces

          protected boolean allowAllNamespaces

  - ### Constructor Detail

    - #### NamespaceAwareNestedTagHandler

          public NamespaceAwareNestedTagHandler​(LoaderContext loaderContext)

    - #### NamespaceAwareNestedTagHandler

          public NamespaceAwareNestedTagHandler​(SAXNestedTagHandler parentHandler,
                                                String targetNamespace)

    - #### NamespaceAwareNestedTagHandler

          public NamespaceAwareNestedTagHandler​(NamespaceAwareNestedTagHandler parentHandler)

  - ### Method Detail

    - #### processElement

          protected abstract boolean processElement​(String namespaceURI,
                                                    String localName,
                                                    Attributes attributes)
                                             throws SAXException

      Description copied from class: `SAXNestedTagHandler`
      Main method to process XML content. Should be override in subclasses, by default do nothing. Return value should be true if tag was fully processed and shouldn't be passed down to child handler.
      Overrides:
        `processElement` in class `SAXNestedTagHandler`
      Parameters:
        `namespaceURI` - namespace for tag
        `localName` - tag local name (i.e. w/o namespace prefix)
        `attributes` - tag attributes
      Returns:
        true if tag was processed
      Throws:
        `SAXException` - can be thrown to abort parsing
      See Also:
        `SAXNestedTagHandler.createChildTagHandler(String, String, String, Attributes)`

    - #### processCharData

          protected void processCharData​(String localName,
                                         String data)

    - #### characters

          public void characters​(char[] ch,
                                 int start,
                                 int length)
                          throws SAXException

      Specified by:
        `characters` in interface `ContentHandler`
      Overrides:
        `characters` in class `DefaultHandler`
      Throws:
        `SAXException`

    - #### startElement

          public final void startElement​(String namespaceURI,
                                         String localName,
                                         String qName,
                                         Attributes attributes)
                                  throws SAXException

      Description copied from class: `SAXNestedTagHandler`
      This method directly called by SAX parser, do not override it directly, use `SAXNestedTagHandler.processElement(String, String, Attributes)` method instead to process content.
      Specified by:
        `startElement` in interface `ContentHandler`
      Overrides:
        `startElement` in class `SAXNestedTagHandler`
      Throws:
        `SAXException`
      See Also:
        `SAXNestedTagHandler.createChildTagHandler(String, String, String, Attributes)`

    - #### endElement

          public void endElement​(String namespaceURI,
                                 String localName,
                                 String qName)
                          throws SAXException

      Specified by:
        `endElement` in interface `ContentHandler`
      Overrides:
        `endElement` in class `SAXNestedTagHandler`
      Throws:
        `SAXException`

    - #### createChildTagHandler

          protected ContentHandler createChildTagHandler​(String namespaceURI,
                                                         String localName,
                                                         String qName,
                                                         Attributes attributes)

      Description copied from class: `SAXNestedTagHandler`
      This method should be used to create nested handlers to process children elements. This method should never return `null`.
      Overrides:
        `createChildTagHandler` in class `SAXNestedTagHandler`
      Parameters:
        `namespaceURI` - namespace for tag
        `localName` - tag local name (i.e. w/o namespace prefix)
        `qName` - tag full name (i.e. with namespace prefix)
        `attributes` - tag attributes
      Returns:
        new handler to process child tag

    - #### setTargetNamespace

          public void setTargetNamespace​(String targetNamespace)

    - #### setAllowAllNamespaces

          public void setAllowAllNamespaces​(boolean allowAllNamespaces)