public class MxNode extends 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: http://www.prowidesoftware.com/integrator.jsp
Modifier and Type | Field and Description |
---|---|
static String |
PATH_SEPARATOR |
Constructor and Description |
---|
MxNode() |
MxNode(MxNode parent,
String localName) |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(String name,
String value)
Adds the given attribute to the node.
|
List<MxNode> |
find(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(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(String name)
Traverse the tree from this node looking for the first node matching the given name.
|
String |
getAttribute(String name) |
Map<String,String> |
getAttributes() |
List<MxNode> |
getChildren() |
MxNode |
getParent() |
MxNode |
getRoot() |
String |
getValue() |
String |
path()
Builds this node's path up to the root element
|
void |
print()
Prints this node tree structure in standard output
|
void |
setAttributes(Map<String,String> attributes) |
void |
setValue(String value) |
String |
singlePathValue(String path) |
String |
toString() |
public static final transient String PATH_SEPARATOR
public MxNode findFirst(String path)
path
- absolute or relative path to findpublic List<MxNode> find(String path)
path
- absolute or relative path to findpublic MxNode getRoot()
public String getValue()
public void setValue(String value)
public void print()
public MxNode getParent()
public MxNode findFirstByName(String name)
name
- a node name to findpublic void addAttribute(String name, String value)
public String getAttribute(String name)
public String path()