org.modeshape.sequencer.teiid.xmi

## Class XmiElement

- java.lang.Object
- - org.modeshape.sequencer.teiid.xmi.XmiBasePart
  - - org.modeshape.sequencer.teiid.xmi.XmiElement

- All Implemented Interfaces:
    XmiDescendent, XmiPart

      public class XmiElement
      extends XmiBasePart
      implements XmiDescendent

  An element from an XMI file.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `NAME_ATTR_NAME` The name of the attribute used as the name attribute.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XmiElement(String name)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAttribute(XmiAttribute newAttribute)`
    `void` | `addChild(XmiElement newChild)`
    `boolean` | `equals(Object obj)`
    `XmiElement` | `findChild(String childName, String namespaceUri)`
    `XmiAttribute` | `getAttribute(String name, String namespaceUri)`
    `List<XmiAttribute>` | `getAttributes()`
    `List<XmiAttribute>` | `getAttributes(String namespaceUri)`
    `String` | `getAttributeValue(String name, String namespaceUri)`
    `List<XmiElement>` | `getChildren()`
    `XmiAttribute` | `getNameAttribute(String namespaceUri)`
    `String` | `getNamespacePrefix()`
    `String` | `getNamespaceUri()`
    `XmiElement` | `getParent()`
    `String` | `getUuid()`
    `int` | `hashCode()`
    `void` | `setParent(XmiElement parent)`
    `String` | `toString()`

    - ### Methods inherited from class org.modeshape.sequencer.teiid.xmi.XmiBasePart

      `getName, getQName, getValue, setNamespacePrefix, setNamespaceUri, setValue`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.modeshape.sequencer.teiid.xmi.XmiPart

      `getName, getQName, getValue`

- - ### Field Detail

    - #### NAME_ATTR_NAME

          public static final String NAME_ATTR_NAME

      The name of the attribute used as the name attribute. Defaults to "name" .
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### XmiElement

          public XmiElement(String name)

      Parameters:
        `name` - the element name (cannot be `null` or empty)

  - ### Method Detail

    - #### addAttribute

          public void addAttribute(XmiAttribute newAttribute)

      Parameters:
        `newAttribute` - the attribute being added (cannot be `null`)

    - #### addChild

          public void addChild(XmiElement newChild)

      Parameters:
        `newChild` - the child element being added (cannot be `null`)

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `XmiBasePart`
      See Also:
        `XmiBasePart.equals(java.lang.Object)`

    - #### findChild

          public XmiElement findChild(String childName,
                             String namespaceUri)

      Parameters:
        `childName` - the name of the child being requested (cannot be `null` or empty)
        `namespaceUri` - the URI of the attribute being requested (can be `null` or empty)
      Returns:
        the requested child element or `null` if not found

    - #### getAttribute

          public XmiAttribute getAttribute(String name,
                                  String namespaceUri)

      Parameters:
        `name` - the name of the attribute being requested (cannot be `null` or empty)
        `namespaceUri` - the URI of the attribute being requested (can be `null` or empty)
      Returns:
        the requested attribute or `null` if not found

    - #### getAttributes

          public List<XmiAttribute> getAttributes()

      Returns:
        the attributes (never `null` but can be empty)

    - #### getAttributes

          public List<XmiAttribute> getAttributes(String namespaceUri)

      Parameters:
        `namespaceUri` - the namespace URI of the attributes being requested (can be `null` or empty)
      Returns:
        the requested attributes (never `null` but can be empty)

    - #### getAttributeValue

          public String getAttributeValue(String name,
                                 String namespaceUri)

      Parameters:
        `name` - the name of the attribute whose value is being requested (cannot be `null` or empty)
        `namespaceUri` - the namespace URI of the attribute being requested (can be `null` or empty)
      Returns:
        the requested attribute value (which can be `null` or empty) or `null` if not found

    - #### getChildren

          public List<XmiElement> getChildren()

      Returns:
        the child elements (never `null` but can be empty)

    - #### getNameAttribute

          public XmiAttribute getNameAttribute(String namespaceUri)

      Parameters:
        `namespaceUri` - the namespace URI of the name attribute being requested (can be `null` or empty)
      Returns:
        the name attribute or `null` if not found

    - #### getNamespacePrefix

          public String getNamespacePrefix()

      Specified by:
        `getNamespacePrefix` in interface `XmiPart`
      Overrides:
        `getNamespacePrefix` in class `XmiBasePart`
      Returns:
        the namespace prefix (can be `null` or empty)
      See Also:
        `XmiBasePart.getNamespacePrefix()`

    - #### getNamespaceUri

          public String getNamespaceUri()

      Specified by:
        `getNamespaceUri` in interface `XmiPart`
      Overrides:
        `getNamespaceUri` in class `XmiBasePart`
      Returns:
        the namespace URI (can be `null` or empty)
      See Also:
        `XmiBasePart.getNamespaceUri()`

    - #### getParent

          public XmiElement getParent()

      Specified by:
        `getParent` in interface `XmiDescendent`
      Returns:
        the parent (can be `null`)
      See Also:
        `XmiDescendent.getParent()`

    - #### getUuid

          public String getUuid()

      Returns:
        the XMI UUID or `null` if not set

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `XmiBasePart`
      See Also:
        `XmiBasePart.hashCode()`

    - #### setParent

          public void setParent(XmiElement parent)

      Specified by:
        `setParent` in interface `XmiDescendent`
      Parameters:
        `parent` - the new parent (can be `null`)
      See Also:
        `XmiDescendent.setParent(org.modeshape.sequencer.teiid.xmi.XmiElement)`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `XmiBasePart`
      See Also:
        `Object.toString()`

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.