tigase.jaxmpp.core.client.xml

## Interface Element

- All Known Implementing Classes:
    AbstractField, BooleanField, Candidate, DefaultElement, ElementWrapper, ErrorElement, FixedField, GwtElement, HiddenField, IQ, J2seElement, JabberDataElement, JidMultiField, JidSingleField, ListMultiField, ListSingleField, Message, MessageArchivingModule.Settings, ParcelableElement, Presence, PubSubModule.AffiliationElement, PubSubModule.SubscriptionElement, Stanza, StreamPacket, TextMultiField, TextPrivateField, TextSingleField, Transport, UnifiedRegistrationForm, XmppDelay, XMucUserElement

      public interface Element

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Element` | `addChild(Element child)` Add child element to tree and return the added element.
    `Element` | `findChild(String[] elemPath)`
    `String` | `getAsString()` Get this element as XML string.
    `String` | `getAttribute(String attName)` Get attribute by name.
    `Map<String,String>` | `getAttributes()` Get all attributes as a Map.
    `Element` | `getChildAfter(Element child)` Gets the first child after specified child in children list.
    `List<Element>` | `getChildren()` Get all children of the element.
    `List<Element>` | `getChildren(String name)` Get children by name.
    `List<Element>` | `getChildrenNS(String xmlns)` Get children by namespace.
    `Element` | `getChildrenNS(String name, String xmlns)` Get children by namespace.
    `Element` | `getFirstChild()` Get the first child element of this element.
    `Element` | `getFirstChild(String name)`
    `String` | `getName()` Get name of this element.
    `Element` | `getNextSibling()` Get next sibling to this element or null if no parent or no more siblings exist.
    `Element` | `getParent()` Get parent element of this element.
    `String` | `getValue()` Get element value.
    `String` | `getXMLNS()` Get namespace of this element.
    `void` | `removeAttribute(String key)` Remove attribute from element.
    `void` | `removeChild(Element child)` Remove child from element.
    `void` | `setAttribute(String key, String value)` Set value of attribute.
    `void` | `setAttributes(Map<String,String> attrs)` Set a number of attributes.
    `void` | `setParent(Element parent)` Set element parent.
    `void` | `setValue(String value)` Set value of this element.
    `void` | `setXMLNS(String xmlns)` Change the namespace of this element.

- - ### Method Detail

    - #### addChild

          Element addChild(Element child)
                    throws XMLException

      Add child element to tree and return the added element.
      Parameters:
        `child` - Child to add.
      Returns:
        Added child element.
      Throws:
        `XMLException`

    - #### findChild

          Element findChild(String[] elemPath)
                     throws XMLException

      Throws:
        `XMLException`

    - #### getAsString

          String getAsString()
                      throws XMLException

      Get this element as XML string.
      Returns:
        The normalized XML describing this element.
      Throws:
        `XMLException`

    - #### getAttribute

          String getAttribute(String attName)
                       throws XMLException

      Get attribute by name.
      Parameters:
        `attName` - Name of attribute to fetch.
      Returns:
        Attribute value or null if no such element exist.
      Throws:
        `XMLException`

    - #### getAttributes

          Map<String,String> getAttributes()
                                    throws XMLException

      Get all attributes as a Map.
      Returns:
        Element's attributes.
      Throws:
        `XMLException`

    - #### setAttributes

          void setAttributes(Map<String,String> attrs)
                      throws XMLException

      Set a number of attributes. Add the ones which does not exist.
      Parameters:
        `attrs` - Attributes to set.
      Throws:
        `XMLException`

    - #### getChildAfter

          Element getChildAfter(Element child)
                         throws XMLException

      Gets the first child after specified child in children list. Only to be used internally.
      Parameters:
        `child` - The child to look up.
      Returns:
        The child after specific child.
      Throws:
        `XMLException`

    - #### getChildren

          List<Element> getChildren()
                             throws XMLException

      Get all children of the element.
      Returns:
        A list containing all child elements.
      Throws:
        `XMLException`

    - #### getChildren

          List<Element> getChildren(String name)
                             throws XMLException

      Get children by name.
      Parameters:
        `name` - Name of the children to get.
      Returns:
        A list of the Element with the given name.
      Throws:
        `XMLException`

    - #### getChildrenNS

          List<Element> getChildrenNS(String xmlns)
                               throws XMLException

      Get children by namespace.
      Parameters:
        `xmlns` - Namespace of the children to get.
      Returns:
        A list of children with the given namespace.
      Throws:
        `XMLException`

    - #### getChildrenNS

          Element getChildrenNS(String name,
                                String xmlns)
                         throws XMLException

      Get children by namespace.
      Parameters:
        `name` - Name of the children to get.
        `xmlns` - Namespace of the children to get.
      Returns:
        A list of Elements with the given name and namespace.
      Throws:
        `XMLException`

    - #### getFirstChild

          Element getFirstChild()
                         throws XMLException

      Get the first child element of this element.
      Returns:
        First child element or null if no children.
      Throws:
        `XMLException`

    - #### getFirstChild

          Element getFirstChild(String name)
                         throws XMLException

      Throws:
        `XMLException`

    - #### getName

          String getName()
                  throws XMLException

      Get name of this element.
      Returns:
        Name of the element.
      Throws:
        `XMLException`

    - #### getNextSibling

          Element getNextSibling()
                          throws XMLException

      Get next sibling to this element or null if no parent or no more siblings exist.
      Returns:
        Next sibling element.
      Throws:
        `XMLException`

    - #### getParent

          Element getParent()
                     throws XMLException

      Get parent element of this element. Or null if no parent exist.
      Returns:
        Parent element.
      Throws:
        `XMLException`

    - #### setParent

          void setParent(Element parent)
                  throws XMLException

      Set element parent. Only to be used internally.
      Parameters:
        `parent` - The parent to set for this element.
      Throws:
        `XMLException`

    - #### getValue

          String getValue()
                   throws XMLException

      Get element value.
      Returns:
        Concatenated string value of element or null if none.
      Throws:
        `XMLException`

    - #### setValue

          void setValue(String value)
                 throws XMLException

      Set value of this element.
      Parameters:
        `value` - Value to set.
      Throws:
        `XMLException`

    - #### getXMLNS

          String getXMLNS()
                   throws XMLException

      Get namespace of this element. traverses up to find actual namespace.
      Returns:
        Namespace of this element.
      Throws:
        `XMLException`

    - #### setXMLNS

          void setXMLNS(String xmlns)
                 throws XMLException

      Change the namespace of this element.
      Parameters:
        `xmlns` - Namespace to set.
      Throws:
        `XMLException`

    - #### removeAttribute

          void removeAttribute(String key)
                        throws XMLException

      Remove attribute from element.
      Parameters:
        `key` - Name of attribute to remove.
      Throws:
        `XMLException`

    - #### removeChild

          void removeChild(Element child)
                    throws XMLException

      Remove child from element.
      Parameters:
        `child` - Child element to remove.
      Throws:
        `XMLException`

    - #### setAttribute

          void setAttribute(String key,
                            String value)
                     throws XMLException

      Set value of attribute. Add attribute if it does not exist.
      Parameters:
        `key` - Name of attribute to set.
        `value` - Value of attribute to set.
      Throws:
        `XMLException`

Copyright © 2006–2019 Tigase. All rights reserved.