Modifier | Constructor and Description |
---|---|
protected |
Node(Element container)
Creates a new node, setting its container to the provided value.
|
Modifier and Type | Method and 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 Map<String,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(PrintWriter writer)
Writes the markup for this node to the writer.
|
String |
toString()
Invokes
toMarkup(PrintWriter) , collecting output in a string, which is returned. |
Element |
wrap(String elementName,
String... namesAndValues)
Wraps a node inside a new element.
|
public Element getContainer()
Element
for this node, or null if this node is the root
element of the document.public Document getDocument()
public String toString()
toMarkup(PrintWriter)
, collecting output in a string, which is returned.public void toMarkup(PrintWriter writer)
protected Map<String,String> getNamespaceURIToPrefix()
public Node moveBefore(Element element)
element
- to move the node beforepublic Node moveAfter(Element element)
element
- to move the node afterpublic Node moveToTop(Element element)
element
- to move the node insidepublic Node moveToBottom(Element element)
element
- to move the node insidepublic void remove()
public Element wrap(String elementName, String... namesAndValues)
elementName
- name of new element to createnamesAndValues
- to set attributes of new element5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.