Class CGINJXPathContext


  • public class CGINJXPathContext
    extends Object
    Wraps a JXPathContext in such a way that rhino grants the security permissions that it needs.
    • 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 context
        contextBean - 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.
      • iteratePointers

        public Iterator<?> iteratePointers​(String xpath)
        Delegates to the JXPathContext method of the same name.