de.vc.xml

## Class DefaultNode

- java.lang.Object
- - de.vc.xml.AbstractNode
  - - de.vc.xml.AbstractNodeWithAttributes
    - - de.vc.xml.DefaultNode

- All Implemented Interfaces:
    Node, NodeElement, java.io.Serializable, java.lang.Cloneable
  Direct Known Subclasses:
    UnresolvedCompareField

      public class DefaultNode
      extends AbstractNodeWithAttributes

  This a default implementation of a node. Attributes are hold in HashMap.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class de.vc.xml.AbstractNodeWithAttributes

      `MAP_TYPE_FLYWEIGHT, MAP_TYPE_HASH`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `DefaultNode(java.lang.String tag)`
    `protected` | `DefaultNode(java.lang.String tag, Node parent)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(int idx, NodeElement child)` Deprecated. This method was replaced by addElement(int, Object).
    `void` | `add(NodeElement child)` Deprecated. This method was replaced by addElement(Object).
    `void` | `addElement(int index, java.lang.Object e)` Adds a node element at `index` to this node.
    `void` | `addElement(java.lang.Object e)` Adds a node element to this node.
    `java.lang.Object` | `clone()` Clones this element.
    `DefaultNode` | `createAndAddChild(java.lang.String childNodeName)`
    `java.util.List<java.lang.Object>` | `getElements()` Gets childreen of this node.
    `void` | `remove(NodeElement child)` Deprecated. This method was replaced by removeElement(Object).
    `java.lang.Object` | `removeElement(int i)` Removes an element from this node.
    `boolean` | `removeElement(java.lang.Object e)` Removes an element from this node.
    `boolean` | `replaceElement(java.lang.Object oldElement, java.lang.Object newElement)` Replaces an element.
    `java.lang.Object` | `setElement(int index, java.lang.Object e)` Replaces a node element at `index` of this node.

    - ### Methods inherited from class de.vc.xml.AbstractNodeWithAttributes

      `doGetAttribute, doSetAttribute, getAttributeMap, getDefaultMapType, getDefinedAttributes, setDefaultMapType`

    - ### Methods inherited from class de.vc.xml.AbstractNode

      `addAttributeChangeListener, addElements, addElements, clearEqualAttributes, clearInheratedAttribute, clearInheratedAttributes, clearValue, contains, contains, copyAttributes, createID, findFirstNodeWithText, findNode, findNodesWithText, fire, fireSaxEvents, firstElement, getAttrAsBoolean, getAttrAsInteger, getAttrAsString, getAttrAsString, getAttribute, getAttribute, getAttributeMap, getContentText, getContentText, getDefinedAttributes, getElements, getElements, getElements, getFirstElement, getIndex, getLocalName, getNamespacePrefix, getNamespacePrefixes, getNamespaceURI, getParent, getParent, getParent, getParentOrThis, getQName, getRoot, hasEqualAttrs, indexOf, isEmpty, lastElement, liftInheritedAttribute, removeAttributeChangeListener, setAttribute, setAttributes, setAttrIfNotNull, setEnableAttributeChangeEvent, setNamespace, setParent, setQName, setUndefinedAttributes, writeTo, writeTo, writeTo, writeTo`

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

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

- - ### Constructor Detail

    - #### DefaultNode

          public DefaultNode(java.lang.String tag)

    - #### DefaultNode

          protected DefaultNode(java.lang.String tag,
                     Node parent)

  - ### Method Detail

    - #### addElement

          public void addElement(java.lang.Object e)

      Adds a node element to this node.
      Parameters:
        `e` - Node element.
      Throws:
        `java.lang.UnsupportedOperationException` - is throws if no childreen are allowed.
        `java.lang.NullPointerException` - is thrown if `e==null`

    - #### addElement

          public void addElement(int index,
                        java.lang.Object e)

      Adds a node element at `index` to this node.
      Parameters:
        `index` - Index of element.
        `e` - Node element.
      Throws:
        `java.lang.IndexOutOfBoundsException` - is thrown if `index` is out of bounds.
        `java.lang.UnsupportedOperationException` - is throws if no childreen are allowed.
        `java.lang.NullPointerException` - is thrown if `e==null`

    - #### setElement

          public java.lang.Object setElement(int index,
                                    java.lang.Object e)

      Replaces a node element at `index` of this node.
      Parameters:
        `index` - Index of element.
        `e` - Node element.
      Returns:
        Replaced element.
      Throws:
        `java.lang.IndexOutOfBoundsException` - is thrown if `index` is out of bounds.
        `java.lang.UnsupportedOperationException` - is throws if no childreen are allowed.
        `java.lang.NullPointerException` - is thrown if `e==null`

    - #### removeElement

          public boolean removeElement(java.lang.Object e)

      Removes an element from this node.
      Parameters:
        `e` - NodeElement
      Returns:
        `true` if this node contained the specified element.

    - #### removeElement

          public java.lang.Object removeElement(int i)

      Removes an element from this node.
      Parameters:
        `i` - Index of element.
      Returns:
        Removed node element.
      Throws:
        `java.lang.IndexOutOfBoundsException` - is thrown if `index` is out of bounds.

    - #### replaceElement

          public boolean replaceElement(java.lang.Object oldElement,
                               java.lang.Object newElement)

      Replaces an element.
      Parameters:
        `oldElement` - Old element.
        `newElement` - New element.
      Returns:
        `true` if this node contained `oldElement`

    - #### add

          public void add(NodeElement child)

      Deprecated. This method was replaced by addElement(Object).
      Adds a child to this node (at the end of content).
      Parameters:
        `child` - Child.

    - #### add

          public void add(int idx,
                 NodeElement child)

      Deprecated. This method was replaced by addElement(int, Object).
      Adds a child to this node at the given index.
      Parameters:
        `idx` - Index (starting at 0)
        `child` - Child.

    - #### remove

          public void remove(NodeElement child)

      Deprecated. This method was replaced by removeElement(Object).
      Removes a child from this node.
      Parameters:
        `child` - Child.

    - #### clone

          public java.lang.Object clone()
                                 throws java.lang.CloneNotSupportedException

      Description copied from interface: `NodeElement`
      Clones this element. Should return a deep copy!
      Specified by:
        `clone` in interface `NodeElement`
      Overrides:
        `clone` in class `AbstractNodeWithAttributes`
      Returns:
        Clone.
      Throws:
        `java.lang.CloneNotSupportedException`

    - #### getElements

          public java.util.List<java.lang.Object> getElements()

      Description copied from class: `AbstractNode`
      Gets childreen of this node. A child is typical an instance of `NodeElement` or `String`.
      Specified by:
        `getElements` in interface `Node`
      Specified by:
        `getElements` in class `AbstractNode`
      Returns:
        Childreen.

    - #### createAndAddChild

          public DefaultNode createAndAddChild(java.lang.String childNodeName)

© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.