Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG |
Constructor and Description |
---|
NodeXML(Document doc) |
NodeXML(Node node)
Creates new NodeXML
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(String name)
Method addAttribute adds an attribute to a node with all attributes value to null, so you still have to do a setAttribute to add value.
|
NodeXML |
addChild(String name) |
boolean |
attributeExist(String attribute)
get a attribute value (pvdm)
|
Object |
clone() |
protected void |
error(String message)
print error message on the screen (pvdm)
|
Collection<NodeXML> |
getAllChildren() |
String |
getAttributeValue(String attribute)
get a attribute value (pvdm)
|
String |
getAttributeValue(String attribute,
String standardValue)
get a attribute value, with a standard value if the attribute is not found.
|
NodeXML |
getChild()
get the first child node (pvdm)
|
NodeXML |
getChild(String name)
get the first child node with a specific name (gh)
|
Collection<NodeXML> |
getChildren() |
String |
getContent()
get the first text content of the node, if any (grh)
|
String |
getContentPrefix() |
String |
getContentSuffix() |
String |
getName() |
NodeXML |
getNext()
get the next node (pvdm)
|
NodeXML |
getNext(String name)
get the next node (pvdm)
|
Node |
getNode() |
Document |
getOwnerDocument() |
NodeXML |
getParent()
get the first child node (pvdm)
|
int |
getParentDistance(NodeXML inParent)
return the distance in node count form a prent
|
static void |
main(String[] args) |
String |
nodeToString() |
void |
removeChild(NodeXML n) |
NodeXML |
searchChild(String inXpath) |
NodeXML |
searchChild(String name,
String paramName,
String paramValue)
search a node with a specific value for a parameter (pvdm)
|
Collection<NodeXML> |
searchChildren(String inXpath) |
String |
searchValue(String inXpath) |
void |
setAttribute(String name,
String value)
Method setAttribute sets an attrinute to its value, if the attribute does not exist it will be added.
|
void |
setCDATAContent(String content)
setCDATAContent: Set a CDATA content in a DOM, Will add a new CDATA node if there is none.
|
void |
setContent(String content) |
public NodeXML(Node node)
public NodeXML(Document doc)
public NodeXML getChild()
public NodeXML getChild(String name)
name
- name of the node needed (gh)public NodeXML getParent()
public NodeXML getNext()
public NodeXML getNext(String name)
name
- return the next node with this name (pvdm)public String getName()
public String getAttributeValue(String attribute, String standardValue)
attribute
- the name of the attributestandardValue
- the standard value if attribute not found.public boolean attributeExist(String attribute)
protected void error(String message)
public NodeXML searchChild(String name, String paramName, String paramValue)
name
- the name of the node (pvdm)paramName
- the name of the attribute of the node (pvdm)paramValue
- the value of the attribute (pvdm)public NodeXML searchChild(String inXpath) throws XPathExpressionException
XPathExpressionException
public Collection<NodeXML> searchChildren(String inXpath) throws XPathExpressionException
XPathExpressionException
public Collection<NodeXML> getChildren()
public Collection<NodeXML> getAllChildren()
public String searchValue(String inXpath) throws XPathExpressionException
XPathExpressionException
public String getContent()
public String getContentPrefix()
public String getContentSuffix()
public Document getOwnerDocument()
public Node getNode()
public void addAttribute(String name)
name
- name of the new attribute.public void setAttribute(String name, String value)
name
- of the attribute.value
- of the attribute.public void setContent(String content)
public void setCDATAContent(String content)
content
- The content to have as a CDATA section in your node.public void removeChild(NodeXML n)
public Object clone()
clone
in class Object
Clones this XMLNode with the 'deep' attribute set. So it clones this node and the whole subtree of nodes.
public String nodeToString()
public int getParentDistance(NodeXML inParent)
inParent
- public static void main(String[] args)
Copyright © 2012-2018. All Rights Reserved.