|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.japisoft.xpath.XPath
Here the main class for Parsing and Resolving
an XPath expression.
You just have to set your XPathException with the
setXPathExpression
and choose a node for application with
the setReferenceNode
. Finally the resolution is
made by the resolve
method.
Constructor Summary | |
XPath()
This constructor searches the Kit using the system property com.japisoft.jxp.kit. |
|
XPath(XPathKit kit)
Here we pass a kit specific to the XML tree format like DOM, JDOM, fastParser lightweight node |
Method Summary | |
void |
addNamespaceDeclaration(java.lang.String prefix,
java.lang.String uri)
Add a namespace declaration If this prefix apperars in the XPath expression then the tied uri if used for discovering node from the uri namespace |
void |
addVariable(java.lang.String name,
boolean value)
Set a variable value from the XPath expression |
void |
addVariable(java.lang.String name,
double value)
Set a variable value from the XPath expression |
void |
addVariable(java.lang.String name,
int value)
Set a variable value from the XPath expression |
void |
addVariable(java.lang.String name,
NodeSet value)
Set a variable value from the XPath expression |
void |
addVariable(java.lang.String name,
java.lang.String value)
Set a variable value from the XPath expression |
java.lang.String[] |
getSupportedFeatures()
Return a list of supported features by the current kit |
boolean |
isFeatureSupported(java.lang.String feature)
|
void |
removeNamespaceDeclaration(java.lang.String prefix)
Remove a namespace declaration for this prefix |
void |
removeVariable(java.lang.String name)
Remove the variable binding for this name, if an XPath expression contains this name, an error will be thrown |
NodeSet |
resolve()
Resolve the XPath expression for the reference node. |
java.lang.Object |
resolveAny()
Resolve the XPath expression, user has to cast correctly the result as NodeSet, String, Double Boolean |
void |
setFeature(java.lang.String feature,
boolean enable)
Set a feature support for the current kit. |
void |
setReferenceNode(java.lang.Object node)
Reset the reference node for resolution. |
void |
setXPathExpression(java.lang.String expr)
Reset the XPath expression. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XPath(XPathKit kit)
public XPath()
Method Detail |
public void setReferenceNode(java.lang.Object node)
public void setXPathExpression(java.lang.String expr) throws XPathException
expr
- an XPath expression
XPathException
public NodeSet resolve() throws XPathException
XPathException
public java.lang.Object resolveAny() throws XPathException
XPathException
public void addNamespaceDeclaration(java.lang.String prefix, java.lang.String uri)
public void removeNamespaceDeclaration(java.lang.String prefix)
public void addVariable(java.lang.String name, int value)
public void addVariable(java.lang.String name, boolean value)
public void addVariable(java.lang.String name, double value)
public void addVariable(java.lang.String name, java.lang.String value)
public void addVariable(java.lang.String name, NodeSet value)
public void removeVariable(java.lang.String name)
public void setFeature(java.lang.String feature, boolean enable)
public boolean isFeatureSupported(java.lang.String feature)
public java.lang.String[] getSupportedFeatures()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |