com.microfocus.awm.core.internal

## Class XMLElementCreationHandler

- java.lang.Object
- - org.xml.sax.helpers.DefaultHandler
  - - com.microfocus.awm.core.internal.XMLElementCreationHandler

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

      public class XMLElementCreationHandler
      extends org.xml.sax.helpers.DefaultHandler

  Converts an XML file into `XMLElement`s.

  Copyright Micro Focus GmbH.

  Author:
    Ralf Pakosch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XMLElementCreationHandler()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `characters(char[] pCh, int pStart, int pLength)`
    `void` | `endDocument()`
    `void` | `endElement(java.lang.String pUri, java.lang.String pLocalName, java.lang.String pQName)`
    `void` | `error(org.xml.sax.SAXParseException pE)`
    `IXMLElement` | `getRootElement()` Gets the parsed root element.
    `void` | `startElement(java.lang.String pUri, java.lang.String pLocalName, java.lang.String pQName, org.xml.sax.Attributes pAttributes)`
    `java.lang.String` | `toString(IXMLElement pElement)` For testing purposes only.

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

      `endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning`

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

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

- - ### Constructor Detail

    - #### XMLElementCreationHandler

          public XMLElementCreationHandler()

  - ### Method Detail

    - #### startElement

          public void startElement(java.lang.String pUri,
                                   java.lang.String pLocalName,
                                   java.lang.String pQName,
                                   org.xml.sax.Attributes pAttributes)
                            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`

    - #### endElement

          public void endElement(java.lang.String pUri,
                                 java.lang.String pLocalName,
                                 java.lang.String pQName)
                          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`

    - #### characters

          public void characters(char[] pCh,
                                 int pStart,
                                 int pLength)
                          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`

    - #### error

          public void error(org.xml.sax.SAXParseException pE)
                     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`

    - #### endDocument

          public 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`

    - #### toString

          public java.lang.String toString(IXMLElement pElement)

      For testing purposes only.

      Converts the given element into a hierarchical structure showing all the elements children (recursive, including attributes).

      Parameters:
        `pElement` - the element to convert
      Returns:
        a string representation of the element and all its children (recursive)

    - #### getRootElement

          public IXMLElement getRootElement()

      Gets the parsed root element.
      Returns:
        the root element or `null` if the XML file did not contain any element

Copyright © 2015 Micro Focus GmbH. All rights reserved.