Examples of FunctionLibrary


Examples of org.apache.commons.jxpath.FunctionLibrary

     * Create child jxpath configuration
     */
    public JXPathHelperConfiguration(JXPathHelperConfiguration global, Configuration config)
    throws ConfigurationException {
        this.lenient = global.lenient;
        this.library = new FunctionLibrary();
        this.library.addFunctions(global.getLibrary());
        if (global.getNamespaces() != null) {
            this.namespaces = new HashMap(global.getNamespaces());
        }
        setup(config);
View Full Code Here

Examples of org.apache.commons.jxpath.FunctionLibrary

     * Create root jxpath configuration
     */
    public JXPathHelperConfiguration(Configuration config)
    throws ConfigurationException {
        this.lenient = config.getChild("lenient").getValueAsBoolean(true);
        this.library = new FunctionLibrary();
        setup(config);

        // the following is necessary to be able to use methods on objects without
        // explicitely registering extension functions (see PackageFunctions javadoc)
        this.library.addFunctions(new PackageFunctions("", null));
View Full Code Here

Examples of org.apache.commons.jxpath.FunctionLibrary

     * Create child jxpath configuration
     */
    public JXPathHelperConfiguration(JXPathHelperConfiguration global, Configuration config)
    throws ConfigurationException {
        this.lenient = global.lenient;
        this.library = new FunctionLibrary();
        this.library.addFunctions(global.getLibrary());
        if (global.getNamespaces() != null) {
            this.namespaces = new HashMap(global.getNamespaces());
        }
        setup(config);
View Full Code Here

Examples of org.apache.commons.jxpath.FunctionLibrary

     * Create root jxpath configuration
     */
    public JXPathHelperConfiguration(Configuration config)
    throws ConfigurationException {
        this.lenient = config.getChild("lenient").getValueAsBoolean(true);
        this.library = new FunctionLibrary();
        setup(config);

        // the following is necessary to be able to use methods on objects without
        // explicitely registering extension functions (see PackageFunctions javadoc)
        this.library.addFunctions(new PackageFunctions("", null));
View Full Code Here

Examples of org.apache.commons.jxpath.FunctionLibrary

     * Create child jxpath configuration
     */
    public JXPathHelperConfiguration(JXPathHelperConfiguration global, Configuration config)
    throws ConfigurationException {
        this.lenient = global.lenient;
        this.library = new FunctionLibrary();
        this.library.addFunctions(global.getLibrary());
        if (global.getNamespaces() != null) {
            this.namespaces = new HashMap(global.getNamespaces());
        }
        setup(config);
View Full Code Here

Examples of org.apache.commons.jxpath.FunctionLibrary

            testBean = new TestBean();
            context = JXPathContext.newContext(testBean);
            Variables vars = context.getVariables();
            vars.declareVariable("test", new TestFunctions(4, "test"));

            FunctionLibrary lib = new FunctionLibrary();
            lib.addFunctions(new ClassFunctions(TestFunctions.class, "test"));
            lib.addFunctions(new ClassFunctions(TestFunctions2.class, "test"));
            lib.addFunctions(new PackageFunctions("", "call"));
            lib.addFunctions(
                new PackageFunctions(
                    "org.apache.commons.jxpath.ri.compiler.",
                    "jxpathtest"));
            lib.addFunctions(new PackageFunctions("", null));
            context.setFunctions(lib);
            context.getVariables().declareVariable("List.class", List.class);
            context.getVariables().declareVariable("NodeSet.class", NodeSet.class);
        }
        functions = new ClassFunctions(TestFunctions.class, "test");
View Full Code Here

Examples of org.apache.commons.jxpath.FunctionLibrary

        if (context == null) {
            context = JXPathContext.newContext(new TestBean());
            Variables vars = context.getVariables();
            vars.declareVariable("test", new TestFunctions(4, "test"));

            FunctionLibrary lib = new FunctionLibrary();
            lib.addFunctions(new ClassFunctions(TestFunctions.class, "test"));
            lib.addFunctions(new ClassFunctions(TestFunctions2.class, "test"));
            lib.addFunctions(new PackageFunctions("", "call"));
            lib.addFunctions(
                new PackageFunctions(
                    "org.apache.commons.jxpath.ri.compiler.",
                    "jxpathtest"));
            lib.addFunctions(new PackageFunctions("", null));
            context.setFunctions(lib);
        }
        functions = new ClassFunctions(TestFunctions.class, "test");
    }
View Full Code Here

Examples of org.pdf4j.saxon.functions.FunctionLibrary

        getExecutable().explainNamedTemplates(presenter);
        FunctionLibraryList libList = (FunctionLibraryList)getExecutable().getFunctionLibrary();
        List libraryList = libList.getLibraryList();
        presenter.startElement("functions");
        for (int i=0; i<libraryList.size(); i++) {
            FunctionLibrary lib = (FunctionLibrary)libraryList.get(i);
            if (lib instanceof ExecutableFunctionLibrary) {
                for (Iterator f = ((ExecutableFunctionLibrary)lib).iterateFunctions(); f.hasNext();) {
                    UserFunction func = (UserFunction)f.next();
                    presenter.startElement("function");
                    presenter.emitAttribute("name", func.getFunctionName().getDisplayName());
View Full Code Here

Examples of org.teiid.query.function.FunctionLibrary

        caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
        caps.setCapabilitySupport(Capability.CRITERIA_NOT, true);
        caps.setFunctionSupport("xyz", true);         //$NON-NLS-1$
        capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$

        FunctionLibrary funcLibrary = new FunctionLibrary(FakeMetadataFactory.SFM.getSystemFunctions(), new FunctionTree("foo", new FakeFunctionMetadataSource()));
        FakeMetadataFacade metadata = new FakeMetadataFacade(FakeMetadataFactory.example1Cached().getStore(), funcLibrary);
       
        
        ProcessorPlan plan = helpPlan(
            "SELECT e1 FROM pm1.g1 WHERE xyz() > 0"//$NON-NLS-1$
View Full Code Here

Examples of org.teiid.query.function.FunctionLibrary

      //explicitly denied
        helpTest(exampleAuthSvc2(), "create local temporary table x (y string)", FakeMetadataFactory.example1Cached(), new String[] {"x"}, FakeMetadataFactory.example1VDB()); //$NON-NLS-1$
    }
   
    @Test public void testFunction() throws Exception {
      FunctionLibrary funcLibrary = new FunctionLibrary(FakeMetadataFactory.SFM.getSystemFunctions(), new FunctionTree("foo", new FakeFunctionMetadataSource()));
        FakeMetadataFacade metadata = new FakeMetadataFacade(FakeMetadataFactory.example1Cached().getStore(), funcLibrary);
      helpTest(exampleAuthSvc1(), "SELECT e1 FROM pm1.g1 where xyz() > 0", metadata, new String[] {}, FakeMetadataFactory.example1VDB()); //$NON-NLS-1$
        helpTest(exampleAuthSvc2(), "SELECT e1, curdate() FROM pm1.g2 where xyz() > 0", metadata, new String[] {"xyz()"}, FakeMetadataFactory.example1VDB()); //$NON-NLS-1$
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.