com.microfocus.awm.model.internal

## Class XMLElement

- java.lang.Object
- - com.microfocus.awm.model.internal.XMLElement

- All Implemented Interfaces:
    IXMLElement

      public class XMLElement
      extends java.lang.Object
      implements IXMLElement

  Implementation of `IXMLElement`.

  Copyright Micro Focus GmbH.

  Author:
    Ralf Pakosch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XMLElement(java.lang.String pName, java.util.Map<java.lang.String,java.lang.String> pAttributes)` Basic constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addChild(XMLElement pChild)` Adds a new child to the list of children.
    `java.util.Map<java.lang.String,java.lang.String>` | `getAttributes()` Gets the element's attributes.
    `java.lang.String` | `getCharacters()` Gets the content/characters of the XML element.
    `java.util.List<IXMLElement>` | `getChildren()` Gets the children elements.
    `java.util.List<IXMLElement>` | `getChildren(java.lang.String pName)` Gets a list of XML child elements with the given name (case sensitive).
    `java.lang.String` | `getName()` Gets the element's name.
    `void` | `setCharacters(java.lang.String pCharacters)` Sets the characters.
    `java.lang.String` | `toString()`

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

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

- - ### Constructor Detail

    - #### XMLElement

          public XMLElement(java.lang.String pName,
                            java.util.Map<java.lang.String,java.lang.String> pAttributes)

      Basic constructor.
      Parameters:
        `pName` - the XML element name
        `pAttributes` - the element attributes

  - ### Method Detail

    - #### getAttributes

          public java.util.Map<java.lang.String,java.lang.String> getAttributes()

      Description copied from interface: `IXMLElement`
      Gets the element's attributes.
      Specified by:
        `getAttributes` in interface `IXMLElement`
      Returns:
        the attributes

    - #### getName

          public java.lang.String getName()

      Description copied from interface: `IXMLElement`
      Gets the element's name.
      Specified by:
        `getName` in interface `IXMLElement`
      Returns:
        the element name

    - #### getChildren

          public java.util.List<IXMLElement> getChildren()

      Description copied from interface: `IXMLElement`
      Gets the children elements.
      Specified by:
        `getChildren` in interface `IXMLElement`
      Returns:
        the children (can be `null`)

    - #### getCharacters

          public java.lang.String getCharacters()

      Description copied from interface: `IXMLElement`
      Gets the content/characters of the XML element.

      E.g.:
      `<myElement>characters</myElement>`

      Specified by:
        `getCharacters` in interface `IXMLElement`
      Returns:
        the contents (can be `null`)

    - #### addChild

          public void addChild(XMLElement pChild)

      Adds a new child to the list of children. Creates the list if it was `null` before.
      Parameters:
        `pChild` - the child to be added

    - #### setCharacters

          public void setCharacters(java.lang.String pCharacters)

      Sets the characters.
      Parameters:
        `pCharacters` - the characters to set

    - #### getChildren

          public java.util.List<IXMLElement> getChildren(java.lang.String pName)

      Description copied from interface: `IXMLElement`
      Gets a list of XML child elements with the given name (case sensitive). Only searches within the direct children of this element.
      Specified by:
        `getChildren` in interface `IXMLElement`
      Parameters:
        `pName` - the name of the desired children elements
      Returns:
        the children with the given name or an empty list if there are no children with the given name

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 2015 Micro Focus GmbH. All rights reserved.