|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CompiledExpression
Represents a compiled XPath. The interpretation of compiled XPaths
may be faster, because it bypasses the compilation step. The reference
implementation of JXPathContext
also globally caches some of the
results of compilation, so the direct use of JXPathContext is not
always less efficient than the use of CompiledExpression.
Use CompiledExpression only when there is a need to evaluate the same expression multiple times and the CompiledExpression can be conveniently cached.
To acquire a CompiledExpression, call JXPathContext.compile
Method Summary | |
---|---|
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) . |
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. |
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. |
Method Detail |
---|
java.lang.Object getValue(JXPathContext context)
context
- to evaluate
java.lang.Object getValue(JXPathContext context, java.lang.Class requiredType)
context
- to evaluaterequiredType
- return type
void setValue(JXPathContext context, java.lang.Object value)
context
- basevalue
- to setPointer createPath(JXPathContext context)
AbstractFactory
, which should first be
installed on the context by calling JXPathContext.setFactory(org.apache.commons.jxpath.AbstractFactory)
.
context
- base
Pointer createPathAndSetValue(JXPathContext context, java.lang.Object value)
AbstractFactory
, 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:
context
- basevalue
- to set
java.util.Iterator iterate(JXPathContext context)
context
- base
Pointer getPointer(JXPathContext context, java.lang.String xpath)
context
- basexpath
- string
java.util.Iterator iteratePointers(JXPathContext context)
context
- to iterate
void removePath(JXPathContext context)
context
- basevoid removeAll(JXPathContext context)
context
- base
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |