Example usage for org.apache.commons.jxpath.ri JXPathContextReferenceImpl addNodePointerFactory

List of usage examples for org.apache.commons.jxpath.ri JXPathContextReferenceImpl addNodePointerFactory

Introduction

In this page you can find the example usage for org.apache.commons.jxpath.ri JXPathContextReferenceImpl addNodePointerFactory.

Prototype

public static void addNodePointerFactory(NodePointerFactory factory) 

Source Link

Document

Call this with a custom NodePointerFactory to add support for additional types of objects.

Usage

From source file:org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.java

public void initialize() throws Exception {
    if (enableDebugger) {
        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Flow debugger enabled, creating");
        }/*from w  ww  . j  a v  a 2  s .c om*/
        getDebugger().doBreak();
    }
    Context context = Context.enter();
    context.setOptimizationLevel(OPTIMIZATION_LEVEL);
    context.setCompileFunctionsWithDynamicScope(true);
    context.setGeneratingDebug(true);
    // add support for Rhino objects to JXPath
    JXPathIntrospector.registerDynamicClass(Scriptable.class, ScriptablePropertyHandler.class);
    JXPathContextReferenceImpl.addNodePointerFactory(new ScriptablePointerFactory());

    try {
        scope = new Global(context);
        // Access to Cocoon internal objects
        FOM_Cocoon.init(scope);
        errorReporter = new JSErrorReporter(getLogger());
    } catch (Exception e) {
        Context.exit();
        e.printStackTrace();
        throw e;
    }
}

From source file:org.lilyproject.runtime.conf.jxpath.ConfPointerFactory.java

public static synchronized void register() {
    if (!registered) {
        registered = true;//from w  w w .  ja  v  a 2  s. c  o m
        JXPathContextReferenceImpl.addNodePointerFactory(new ConfPointerFactory());
    }
}

From source file:org.sweble.wikitext.parser.XPathTest.java

public XPathTest() {
    JXPathContextReferenceImpl.addNodePointerFactory(new AstNodePointerFactory());

    parser = new NonExpandingParser(WARNINGS_ENABLED, GATHER_RTD, AUTO_CORRECT);
}