|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dyuproject.util.xml.SimpleNode
public class SimpleNode
Simple node that persists the attributes in a Map
, text content
in a StringBuilder
and child nodes in a List
.
Constructor Summary | |
---|---|
SimpleNode(String name)
|
|
SimpleNode(String name,
Node parent)
|
|
SimpleNode(String name,
Node parent,
String namespace)
|
|
SimpleNode(String name,
String namespace)
|
Method Summary | |
---|---|
void |
addNode(Node node)
Adds a child node. |
void |
addText(char[] buf,
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 . |
static void |
setDefaultBufferSize(int size)
Sets the default buffer size for the text content. |
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. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimpleNode(String name)
public SimpleNode(String name, String namespace)
public SimpleNode(String name, Node parent)
public SimpleNode(String name, Node parent, String namespace)
Method Detail |
---|
public static void setDefaultBufferSize(int size)
public void setParent(Node parent)
Node
setParent
in interface Node
public Node getParent()
Node
getParent
in interface Node
public boolean isRoot()
Node
isRoot
in interface Node
public int size()
Node
size
in interface Node
public boolean hasAttribute(String name)
Node
name
is present.
hasAttribute
in interface Node
public void setAttribute(String name, String value)
Node
name
and value
.
setAttribute
in interface Node
public String getAttribute(String name)
Node
name
.
getAttribute
in interface Node
public void setName(String name)
Node
setName
in interface Node
public String getName()
Node
getName
in interface Node
public void setNamespace(String namespace)
Node
setNamespace
in interface Node
public String getNamespace()
Node
getNamespace
in interface Node
public List<Node> getNodes()
Node
getNodes
in interface Node
public List<Node> getNodes(String name)
Node
name
(filtered).
getNodes
in interface Node
public void addNode(Node node)
Node
addNode
in interface Node
public Node getNode(int index)
Node
index
.
getNode
in interface Node
public Node getLastNode()
Node
getLastNode
in interface Node
public Node getFirstNode()
Node
getFirstNode
in interface Node
public void addText(char[] buf, int start, int length)
Node
addText
in interface Node
public void addText(String text)
Node
addText
in interface Node
public void addText(StringBuilder text)
Node
addText
in interface Node
public void addText(StringBuffer text)
Node
addText
in interface Node
public StringBuilder getText()
Node
getText
in interface Node
public String toString()
toString
in class Object
public Node getNode(String name)
Node
name
.
getNode
in interface Node
public Node getNode(String name, int startingIndex)
Node
name
, starting at startingIndex
.
getNode
in interface Node
public Node getNodeFromLast(String name)
Node
name
, starting from the last.
getNodeFromLast
in interface Node
public Node getNodeFromLast(String name, int startingIndex)
Node
name
, starting from the last with the
specified startingIndex
.
getNodeFromLast
in interface Node
public int indexOf(String name)
Node
name
.
indexOf
in interface Node
public int indexOf(String name, int startingIndex)
Node
name
, starting
at startingIndex
.
indexOf
in interface Node
public int lastIndexOf(String name)
Node
name
, starting from the last.
lastIndexOf
in interface Node
public int lastIndexOf(String name, int startingIndex)
Node
name
, starting from last with
the specified startingIndex
.
lastIndexOf
in interface Node
public String removeAttribute(String name)
Node
name
.
removeAttribute
in interface Node
public Node removeNode(int index)
Node
index
.
removeNode
in interface Node
public boolean removeNode(Node node)
Node
removeNode
in interface Node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |