The reference implementation of JXPathContext.
addNodePointerFactory
public static void addNodePointerFactory(NodePointerFactory factory)
Call this with a custom NodePointerFactory to add support for
additional types of objects. Make sure the factory returns
a name that puts it in the right position on the list of factories.
allocateConditionally
public static Object allocateConditionally(String className,
String existenceCheckClassName)
Checks if existenceCheckClass exists on the class path. If so, allocates
an instance of the specified class, otherwise returns null.
createPathAndSetValue
public Pointer createPathAndSetValue(String xpath,
Expression expr,
Object value)
getAbsoluteRootContext
public EvalContext getAbsoluteRootContext()
getCompiler
protected Compiler getCompiler()
Returns a static instance of TreeCompiler.
Override this to return an aternate compiler.
getFunction
public Function getFunction(QName functionName,
Object[] parameters)
getValue
public Object getValue(String xpath)
Traverses the xpath and returns the resulting object. Primitive
types are wrapped into objects.
- getValue in interface JXPathContext
getValue
public Object getValue(String xpath,
Class requiredType)
Calls getValue(xpath), converts the result to the required type
and returns the result of the conversion.
- getValue in interface JXPathContext
getValue
public Object getValue(String xpath,
Expression expr)
getValue
public Object getValue(String xpath,
Expression expr,
Class requiredType)
iterate
public Iterator iterate(String xpath)
Traverses the xpath and returns a Iterator of all results found
for the path. If the xpath matches no properties
in the graph, the Iterator will not be null.
- iterate in interface JXPathContext
iterate
public Iterator iterate(String xpath,
Expression expr)
iteratePointers
public Iterator iteratePointers(String xpath)
Traverses the xpath and returns an Iterator of Pointers.
A Pointer provides easy access to a property.
If the xpath matches no properties
in the graph, the Iterator be empty, but not null.
- iteratePointers in interface JXPathContext
iteratePointers
public Iterator iteratePointers(String xpath,
Expression expr)
removeAll
public void removeAll(String xpath,
Expression expr)
removePath
public void removePath(String xpath,
Expression expr)
setValue
public void setValue(String xpath,
Expression expr,
Object value)