| Modifier and Type | Method and Description |
|---|---|
Node |
Node.attribute(String name,
Object value)
Add or override a named attribute.
value will be converted to String using String.valueOf(value); |
Node |
Node.attribute(String name,
String value)
Add or override a named attribute.
|
Node |
Node.createChild(String name)
Create a new
Node with given name. |
Node |
Node.getOrCreate(String name)
Get or create a named child node.
|
Node |
Node.getParent()
Get the Nodes parent.
|
Node |
Node.getRoot()
Obtains the root
Node for this reference |
Node |
Node.getSingle(String name)
Get a single child node.
If multiple children are found with same name it is considered a IllegalArgumentException. |
static Node |
XMLParser.parse(byte[] xml) |
static Node |
XMLParser.parse(File file) |
static Node |
XMLParser.parse(InputStream stream) |
static Node |
XMLParser.parse(String xml) |
Node |
Node.removeChild(String name)
Remove a single child from this
Node |
Node |
Node.text(Object text)
Set the Nodes text body.
text will be converted to String using String.valueOf(text); |
Node |
Node.text(String text)
Set the Nodes text body.
|
| Modifier and Type | Method and Description |
|---|---|
List<Node> |
Node.get(String name)
Get all children with a specific name.
|
List<Node> |
Node.getChildren()
Get all the defined children for this node in an immutable view.
|
List<Node> |
Node.removeChildren(String name)
Remove all child nodes found at the given query.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
Node.removeChild(Node child)
Remove a single child from this
Node |
static byte[] |
XMLParser.toXMLByteArray(Node node) |
static InputStream |
XMLParser.toXMLInputStream(Node node) |
static String |
XMLParser.toXMLString(Node node) |
| Constructor and Description |
|---|
Node(String name,
Node parent)
Creates a
Node |
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.