public class MxNode
extends java.lang.Object
This class represents a node element within a tree of MX message. It is basically a generic XML node structure used to provide basic parsing functionallity for MX messages in Prowide Core.
Note than full business model is provided only for the business header, while a complete MX model is implemented in Prowide Integrator. For more information on the full MX model implementation please check: Prowide Integrator
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PATH_SEPARATOR |
Constructor and Description |
---|
MxNode() |
MxNode(MxNode parent,
java.lang.String localName) |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(java.lang.String name,
java.lang.String value)
Adds the given attribute to the node.
|
java.util.List<MxNode> |
find(java.lang.String path)
Given a basic path, find all nodes matching the path parameter.
If the path starts with '/' it will search from the root element, else it will search from this node. |
MxNode |
findFirst(java.lang.String path)
Given a basic path, find the first instance of a node matching the
path parameter.
If the path starts with '/' it will search from the root element, else it will search from this node. |
MxNode |
findFirstByName(java.lang.String name)
Traverse the tree from this node looking for the first node matching the given name.
|
java.lang.String |
getAttribute(java.lang.String name) |
java.util.Map<java.lang.String,java.lang.String> |
getAttributes() |
java.util.List<MxNode> |
getChildren() |
MxNode |
getParent() |
MxNode |
getRoot() |
java.lang.String |
getValue() |
java.lang.String |
path()
Builds this node's path up to the root element
|
void |
print()
Prints this node tree structure in standard output
|
void |
setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes) |
void |
setValue(java.lang.String value) |
java.lang.String |
singlePathValue(java.lang.String path) |
java.lang.String |
toString() |
public static final transient java.lang.String PATH_SEPARATOR
public MxNode()
public MxNode(MxNode parent, java.lang.String localName)
public java.lang.String singlePathValue(java.lang.String path)
public MxNode findFirst(java.lang.String path)
path
- absolute or relative path to findpublic java.util.List<MxNode> find(java.lang.String path)
path
- absolute or relative path to findpublic MxNode getRoot()
public java.lang.String getValue()
public void setValue(java.lang.String value)
public java.lang.String toString()
toString
in class java.lang.Object
public void print()
public MxNode getParent()
public MxNode findFirstByName(java.lang.String name)
name
- a node name to findpublic java.util.List<MxNode> getChildren()
public java.util.Map<java.lang.String,java.lang.String> getAttributes()
public void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
public void addAttribute(java.lang.String name, java.lang.String value)
public java.lang.String getAttribute(java.lang.String name)
public java.lang.String path()