|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.xml.javax.NodeXmlObject
public class NodeXmlObject
A java 5 implementation of XmlObject wrapping a Node.
| Constructor Summary | |
|---|---|
NodeXmlObject(Node node)
Constructs a new xml object using the given Node. |
|
NodeXmlObject(Node node,
Map<String,String> namespaces)
|
|
| Method Summary | |
|---|---|
boolean |
canCompileXpath()
Returns true since xpath expression compilation is supported. |
XmlXPathExpression |
compile(String path)
Compiles the given xpath expression. |
String |
getName()
Returns the node name, if the Node.getLocalName() is not null
will return it, otherwise will return Node.getNodeName(). |
Map<String,String> |
getNamespaces()
Returns a lookup map for namespaces (prefix to uri). |
Node |
getNode()
Returns the Node this xml object wraps. |
String |
getValue()
Returns the node value, using Node.getNodeValue() with the
exception of element, which has special handling using DomUtils.getTextValue(org.w3c.dom.Element). |
XmlObject[] |
selectPath(String path)
Compiles and selects the given xpath expression. |
void |
setNamespaces(Map<String,String> namespaces)
Sets a lookup map for given namespaces (prefix to uri). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NodeXmlObject(Node node)
Node.
public NodeXmlObject(Node node,
Map<String,String> namespaces)
| Method Detail |
|---|
public void setNamespaces(Map<String,String> namespaces)
XmlObject
setNamespaces in interface XmlObjectpublic Map<String,String> getNamespaces()
XmlObject
getNamespaces in interface XmlObjectpublic String getName()
Node.getLocalName() is not null
will return it, otherwise will return Node.getNodeName().
getName in interface XmlObjectpublic String getValue()
Node.getNodeValue() with the
exception of element, which has special handling using DomUtils.getTextValue(org.w3c.dom.Element).
getValue in interface XmlObject
public XmlObject[] selectPath(String path)
throws Exception
selectPath in interface XmlObjectpath - The xpath expression
Exceptionpublic boolean canCompileXpath()
true since xpath expression compilation is supported.
canCompileXpath in interface XmlObject
public XmlXPathExpression compile(String path)
throws Exception
compile in interface XmlObjectpath - The xpath expression
Exceptionpublic Node getNode()
Node this xml object wraps.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||