| Constructor and Description |
|---|
JNode(Document document,
String name)
|
JNode(Node node)
|
| Modifier and Type | Method and Description |
|---|---|
JNode |
appendChild(JNode jNode)
Append a
JNode. |
JNode |
appendChild(Node node)
Append an XML
Node. |
JNode |
appendChild(String name)
Append a new
JNode with a given name. |
String |
getAttribute(String attribute)
Returns the value of an attribute.
|
Map<String,String> |
getAttributes()
Returns a
Map of all attributes. |
JNode |
getChild()
Returns the first child.
|
JNode |
getChild(String name)
Returns the first child with a specified name.
|
List<JNode> |
getChildren()
Returns all children.
|
List<JNode> |
getChildren(String name)
Returns all children with a specified name.
|
Document |
getDocument()
Returns the owner
Document. |
String |
getName()
Returns the name.
|
Node |
getNode()
Retrieves the
Node element. |
String |
getText()
Returns the strings content.
|
boolean |
hasAttribute(String attribute)
Returns
true if the attribute is existent. |
boolean |
hasText()
Returns
true if this node has a strings content. |
void |
setAttribute(String attribute,
String value)
Sets an attribute to a value.
|
void |
setText(String text)
Sets the strings content.
|
String |
toString() |
public JNode(Node node)
node - the node to wrappublic String getName()
public Map<String,String> getAttributes()
Map of all attributes.public String getAttribute(String attribute)
attribute - the name of the attributesetAttribute(java.lang.String, java.lang.String)public boolean hasAttribute(String attribute)
true if the attribute is existent.attribute - the name of the attributepublic JNode getChild()
public JNode getChild(String name)
name - the name of the childpublic List<JNode> getChildren(String name)
name - the name of the childrenpublic String getText()
setText(java.lang.String)public boolean hasText()
true if this node has a strings content.true if this node has a strings contentpublic void setText(String text)
text - the strings content to setgetText()public void setAttribute(String attribute, String value)
attribute - the name of the attributevalue - the valuegetAttribute(java.lang.String)public JNode appendChild(String name)
JNode with a given name.name - the specified namepublic JNode appendChild(Node node)
Node.node - the XML nodepublic JNode appendChild(JNode jNode)
JNode.jNode - the node to appendpublic Document getDocument()
Document.