Class CGINJXPathContext
- java.lang.Object
-
- CGINJXPathContext
-
public class CGINJXPathContext extends Object
Wraps aJXPathContext
in such a way that rhino grants the security permissions that it needs.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.apache.commons.jxpath.CompiledExpression
compile(String xpath)
Compiles the supplied XPath, granting the necessary security permissions, and returns an internal representation of the path that can then be evaluated.org.apache.commons.jxpath.Pointer
createPath(String xpath)
Delegates to the JXPathContext method of the same name.org.apache.commons.jxpath.Pointer
createPathAndSetValue(String xpath, Object value)
Delegates to the JXPathContext method of the same name.org.apache.commons.jxpath.Pointer
getContextPointer()
Delegates to the JXPathContext method of the same name.org.apache.commons.jxpath.Pointer
getPointer(String xpath)
Delegates to the JXPathContext method of the same name.org.apache.commons.jxpath.JXPathContext
getRelativeContext(org.apache.commons.jxpath.Pointer pointer)
Delegates to the JXPathContext method of the same name.Object
getValue(String xpath)
Delegates to the JXPathContext method of the same name.Object
getValue(String xpath, Class<?> requiredType)
Delegates to the JXPathContext method of the same name.Iterator<?>
iterate(String xpath)
Delegates to the JXPathContext method of the same name.Iterator<?>
iteratePointers(String xpath)
Delegates to the JXPathContext method of the same name.static CGINJXPathContext
newContext(CGINJXPathContext parentContext, Object contextBean)
Creates a new JXPathContext with the specified bean as the root node and the specified parent context, wrapped up in a CGINJXPathContext.static CGINJXPathContext
newContext(Object contextBean)
Creates a new JXPathContext with the specified object as the root node, wrapped up in a CGINJXPathContext.void
removeAll(String xpath)
Delegates to the JXPathContext method of the same name.void
removePath(String xpath)
Delegates to the JXPathContext method of the same name.void
setValue(String xpath, Object value)
Delegates to the JXPathContext method of the same name.
-
-
-
Method Detail
-
newContext
public static CGINJXPathContext newContext(Object contextBean)
Creates a new JXPathContext with the specified object as the root node, wrapped up in a CGINJXPathContext.- Parameters:
contextBean
- Object- Returns:
- CGINJXPathContext
-
newContext
public static CGINJXPathContext newContext(CGINJXPathContext parentContext, Object contextBean)
Creates a new JXPathContext with the specified bean as the root node and the specified parent context, wrapped up in a CGINJXPathContext. Variables defined in a parent context can be referenced in XPaths passed to the child context.- Parameters:
parentContext
- parent contextcontextBean
- Object- Returns:
- CGINJXPathContext
-
compile
public static org.apache.commons.jxpath.CompiledExpression compile(String xpath)
Compiles the supplied XPath, granting the necessary security permissions, and returns an internal representation of the path that can then be evaluated. Use CompiledExpressions when you need to evaluate the same expression multiple times and there is a convenient place to cache CompiledExpression between invocations.- Parameters:
xpath
- to compile- Returns:
- CompiledExpression
-
getContextPointer
public org.apache.commons.jxpath.Pointer getContextPointer()
Delegates to the JXPathContext method of the same name.
-
getRelativeContext
public org.apache.commons.jxpath.JXPathContext getRelativeContext(org.apache.commons.jxpath.Pointer pointer)
Delegates to the JXPathContext method of the same name.
-
getValue
public Object getValue(String xpath)
Delegates to the JXPathContext method of the same name.
-
getValue
public Object getValue(String xpath, Class<?> requiredType)
Delegates to the JXPathContext method of the same name.
-
setValue
public void setValue(String xpath, Object value)
Delegates to the JXPathContext method of the same name.
-
createPath
public org.apache.commons.jxpath.Pointer createPath(String xpath)
Delegates to the JXPathContext method of the same name.
-
createPathAndSetValue
public org.apache.commons.jxpath.Pointer createPathAndSetValue(String xpath, Object value)
Delegates to the JXPathContext method of the same name.
-
removePath
public void removePath(String xpath)
Delegates to the JXPathContext method of the same name.
-
removeAll
public void removeAll(String xpath)
Delegates to the JXPathContext method of the same name.
-
iterate
public Iterator<?> iterate(String xpath)
Delegates to the JXPathContext method of the same name.
-
getPointer
public org.apache.commons.jxpath.Pointer getPointer(String xpath)
Delegates to the JXPathContext method of the same name.
-
-