|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Node
An xml node for persistence - much like DOM.
Method Summary | |
---|---|
void |
addNode(Node node)
Adds a child node. |
void |
addText(char[] data,
int start,
int length)
Adds text content as char array. |
void |
addText(String text)
Adds text content as String. |
void |
addText(StringBuffer text)
Adds text content as StringBuffer. |
void |
addText(StringBuilder text)
Adds text content as StringBuilder. |
String |
getAttribute(String name)
Gets an attribute mapped with the given name . |
Node |
getFirstNode()
Gets the first child node. |
Node |
getLastNode()
Gets the last child node. |
String |
getName()
Gets the name. |
String |
getNamespace()
Gets the namespace. |
Node |
getNode(int index)
Gets a child node from the given index . |
Node |
getNode(String name)
Gets the first child node with the given name . |
Node |
getNode(String name,
int startingIndex)
Gets the first child node with the given name , starting at startingIndex . |
Node |
getNodeFromLast(String name)
Gets the first child node with the given name , starting from the last. |
Node |
getNodeFromLast(String name,
int startingIndex)
Gets the first child node with the given name , starting from the last with the
specified startingIndex . |
List<Node> |
getNodes()
Gets the list of child nodes. |
List<Node> |
getNodes(String name)
Gets the list of child nodes with the given name (filtered). |
Node |
getParent()
Gets the parent. |
StringBuilder |
getText()
Gets the text content as StringBuilder. |
boolean |
hasAttribute(String name)
Checks whether the attribute name is present. |
int |
indexOf(String name)
Gets the index of the child node with the given name . |
int |
indexOf(String name,
int startingIndex)
Gets the index of the child node with the given name , starting
at startingIndex . |
boolean |
isRoot()
Checks whether this node is root. |
int |
lastIndexOf(String name)
Gets the index of the child node with the given name , starting from the last. |
int |
lastIndexOf(String name,
int startingIndex)
Gets the index of the child node with the given name , starting from last with
the specified startingIndex . |
String |
removeAttribute(String name)
Removes an attribute mapped with the given name . |
Node |
removeNode(int index)
Removes a child node from the given index . |
boolean |
removeNode(Node node)
Removes a child node. |
void |
setAttribute(String name,
String value)
Sets an attribute with the given name and value . |
void |
setName(String name)
Sets the name. |
void |
setNamespace(String namespace)
Sets the namespace. |
void |
setParent(Node parent)
Sets the parent. |
int |
size()
Gets the number of child elements of this node. |
Method Detail |
---|
void setParent(Node parent)
Node getParent()
boolean isRoot()
int size()
void setName(String name)
String getName()
void setNamespace(String namespace)
String getNamespace()
void addText(char[] data, int start, int length)
void addText(String text)
void addText(StringBuilder text)
void addText(StringBuffer text)
StringBuilder getText()
void setAttribute(String name, String value)
name
and value
.
boolean hasAttribute(String name)
name
is present.
String removeAttribute(String name)
name
.
String getAttribute(String name)
name
.
void addNode(Node node)
Node removeNode(int index)
index
.
boolean removeNode(Node node)
List<Node> getNodes()
List<Node> getNodes(String name)
name
(filtered).
Node getFirstNode()
Node getLastNode()
Node getNode(int index)
index
.
Node getNode(String name)
name
.
Node getNode(String name, int startingIndex)
name
, starting at startingIndex
.
Node getNodeFromLast(String name)
name
, starting from the last.
Node getNodeFromLast(String name, int startingIndex)
name
, starting from the last with the
specified startingIndex
.
int indexOf(String name)
name
.
int indexOf(String name, int startingIndex)
name
, starting
at startingIndex
.
int lastIndexOf(String name)
name
, starting from the last.
int lastIndexOf(String name, int startingIndex)
name
, starting from last with
the specified startingIndex
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |