public class JXPathCompiledExpression extends java.lang.Object implements CompiledExpression
| Modifier and Type | Field and Description |
|---|---|
private Expression |
expression |
private java.lang.String |
xpath |
| Constructor and Description |
|---|
JXPathCompiledExpression(java.lang.String xpath,
Expression expression)
Create a new JXPathCompiledExpression.
|
| Modifier and Type | Method and Description |
|---|---|
Pointer |
createPath(JXPathContext context)
Creates intermediate elements of
the path by invoking an
AbstractFactory, which should first be
installed on the context by calling JXPathContext.setFactory(org.apache.commons.jxpath.AbstractFactory). |
Pointer |
createPathAndSetValue(JXPathContext context,
java.lang.Object value)
The same as setValue, except it creates intermediate elements of
the path by invoking an
AbstractFactory, which should first be
installed on the context by calling JXPathContext.setFactory(org.apache.commons.jxpath.AbstractFactory). |
protected Expression |
getExpression()
Get the compiled expression.
|
Pointer |
getPointer(JXPathContext context,
java.lang.String xpath)
Traverses the xpath and returns a Pointer.
|
java.lang.Object |
getValue(JXPathContext context)
Evaluates the xpath and returns the resulting object.
|
java.lang.Object |
getValue(JXPathContext context,
java.lang.Class requiredType)
Evaluates the xpath, converts the result to the specified class and
returns the resulting object.
|
protected java.lang.String |
getXPath()
Get the source expression.
|
java.util.Iterator |
iterate(JXPathContext context)
Traverses the xpath and returns a Iterator of all results found
for the path.
|
java.util.Iterator |
iteratePointers(JXPathContext context)
Traverses the xpath and returns an Iterator of Pointers.
|
void |
removeAll(JXPathContext context)
Remove all graph elements described by this expression.
|
void |
removePath(JXPathContext context)
Remove the graph element described by this expression.
|
void |
setValue(JXPathContext context,
java.lang.Object value)
Modifies the value of the property described by the supplied xpath.
|
java.lang.String |
toString() |
private java.lang.String xpath
private Expression expression
public JXPathCompiledExpression(java.lang.String xpath,
Expression expression)
xpath - sourceexpression - compiledprotected java.lang.String getXPath()
protected Expression getExpression()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Object getValue(JXPathContext context)
CompiledExpressiongetValue in interface CompiledExpressioncontext - to evaluatepublic java.lang.Object getValue(JXPathContext context, java.lang.Class requiredType)
CompiledExpressiongetValue in interface CompiledExpressioncontext - to evaluaterequiredType - return typepublic void setValue(JXPathContext context, java.lang.Object value)
CompiledExpressionsetValue in interface CompiledExpressioncontext - basevalue - to setpublic Pointer createPath(JXPathContext context)
CompiledExpressionAbstractFactory, which should first be
installed on the context by calling JXPathContext.setFactory(org.apache.commons.jxpath.AbstractFactory).createPath in interface CompiledExpressioncontext - basepublic Pointer createPathAndSetValue(JXPathContext context, java.lang.Object value)
CompiledExpressionAbstractFactory, which should first be
installed on the context by calling JXPathContext.setFactory(org.apache.commons.jxpath.AbstractFactory).
Will throw an exception if one of the following conditions occurs:
createPathAndSetValue in interface CompiledExpressioncontext - basevalue - to setpublic java.util.Iterator iterate(JXPathContext context)
CompiledExpressioniterate in interface CompiledExpressioncontext - basepublic Pointer getPointer(JXPathContext context, java.lang.String xpath)
CompiledExpressiongetPointer in interface CompiledExpressioncontext - basexpath - stringpublic java.util.Iterator iteratePointers(JXPathContext context)
CompiledExpressioniteratePointers in interface CompiledExpressioncontext - to iteratepublic void removePath(JXPathContext context)
CompiledExpressionremovePath in interface CompiledExpressioncontext - basepublic void removeAll(JXPathContext context)
CompiledExpressionremoveAll in interface CompiledExpressioncontext - base