Package org.apache.tapestry5.dom

## Class Node

- java.lang.Object
- - org.apache.tapestry5.dom.Node

- Direct Known Subclasses:
    `CData`, `Comment`, `Document`, `Element`, `Raw`, `Text`

      public abstract class Node
      extends java.lang.Object

  A node within the DOM.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `Node​(Element container)` | Creates a new node, setting its container to the provided value.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Element` | `getContainer()` | Returns the containing `Element` for this node, or null if this node is the root element of the document.
    `Document` | `getDocument()` |
    `protected java.util.Map<java.lang.String,​java.lang.String>` | `getNamespaceURIToPrefix()` |
    `Node` | `moveAfter​(Element element)` | Moves this node so that it becomes a sibling of the element, ordered just after the element.
    `Node` | `moveBefore​(Element element)` | Moves this node so that it becomes a sibling of the element, ordered just before the element.
    `Node` | `moveToBottom​(Element element)` | Moves this node so that it the last child of the element.
    `Node` | `moveToTop​(Element element)` | Moves this node so that it becomes this first child of the element, shifting existing elements forward.
    `void` | `remove()` | Removes a node from its container, setting its container property to null, and removing it from its container's list of children.
    `void` | `toMarkup​(java.io.PrintWriter writer)` | Writes the markup for this node to the writer.
    `java.lang.String` | `toString()` | Invokes `toMarkup(PrintWriter)`, collecting output in a string, which is returned.
    `Element` | `wrap​(java.lang.String elementName, java.lang.String... namesAndValues)` | Wraps a node inside a new element.

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

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

- - ### Constructor Detail

    - #### Node

          protected Node​(Element container)

      Creates a new node, setting its container to the provided value. Container may also be null, but that is only used for Document nodes (the topmost node of a DOM).
      Parameters:
        `container` - element containing this node

  - ### Method Detail

    - #### getContainer

          public Element getContainer()

      Returns the containing `Element` for this node, or null if this node is the root element of the document.

    - #### getDocument

          public Document getDocument()

    - #### toString

          public java.lang.String toString()

      Invokes `toMarkup(PrintWriter)`, collecting output in a string, which is returned.
      Overrides:
        `toString` in class `java.lang.Object`

    - #### toMarkup

          public void toMarkup​(java.io.PrintWriter writer)

      Writes the markup for this node to the writer.

    - #### getNamespaceURIToPrefix

          protected java.util.Map<java.lang.String,​java.lang.String> getNamespaceURIToPrefix()

    - #### moveBefore

          public Node moveBefore​(Element element)

      Moves this node so that it becomes a sibling of the element, ordered just before the element.
      Parameters:
        `element` - to move the node before
      Returns:
        the node for further modification

    - #### moveAfter

          public Node moveAfter​(Element element)

      Moves this node so that it becomes a sibling of the element, ordered just after the element.
      Parameters:
        `element` - to move the node after
      Returns:
        the node for further modification

    - #### moveToTop

          public Node moveToTop​(Element element)

      Moves this node so that it becomes this first child of the element, shifting existing elements forward.
      Parameters:
        `element` - to move the node inside
      Returns:
        the node for further modification

    - #### moveToBottom

          public Node moveToBottom​(Element element)

      Moves this node so that it the last child of the element.
      Parameters:
        `element` - to move the node inside
      Returns:
        the node for further modification

    - #### remove

          public void remove()

      Removes a node from its container, setting its container property to null, and removing it from its container's list of children.

    - #### wrap

          public Element wrap​(java.lang.String elementName,
                              java.lang.String... namesAndValues)

      Wraps a node inside a new element. The new element is created before the node, then the node is moved inside the new element.
      Parameters:
        `elementName` - name of new element to create
        `namesAndValues` - to set attributes of new element
      Returns:
        the created element