Examples of UserFunctionCall


Examples of org.pdf4j.saxon.expr.UserFunctionCall

    public Expression bind(StructuredQName functionName, Expression[] arguments, StaticContext env) throws XPathException {
        String functionKey = XQueryFunction.getIdentificationKey(
                functionName, arguments.length);
        XQueryFunction fd = (XQueryFunction)functions.get(functionKey);
        if (fd != null) {
            UserFunctionCall ufc = new UserFunctionCall();
            ufc.setFunctionName(fd.getFunctionName());
            ufc.setArguments(arguments);
            ufc.setStaticType(fd.getResultType());
            UserFunction fn = fd.getUserFunction();
            if (fn == null) {
                // not yet compiled
                fd.registerReference(ufc);
                ufc.setConfirmed(true);
            } else {
                ufc.setFunction(fn);
                ExpressionVisitor visitor = ExpressionVisitor.make(fd.getStaticContext());
                visitor.setExecutable(fd.getExecutable());
                ufc.checkFunctionCall(fn, visitor);
            }
            return ufc;
        } else {
            return null;
        }
View Full Code Here

Examples of org.pdf4j.saxon.expr.UserFunctionCall

    public Expression bind(StructuredQName functionName, Expression[] arguments, StaticContext env) throws XPathException {
        if (resolving) {
            return null;
        }
        UserFunctionCall ufc = new UserFunctionCall();
        ufc.setFunctionName(functionName);
        ufc.setArguments(arguments);
        unboundFunctionCalls.add(ufc);
        correspondingStaticContext.add(env);
        return ufc;
    }
View Full Code Here

Examples of org.pdf4j.saxon.expr.UserFunctionCall

     */

    public void bindUnboundFunctionCalls(XQueryFunctionBinder lib, Configuration config) throws XPathException {
        resolving = true;
        for (int i=0; i<unboundFunctionCalls.size(); i++) {
            UserFunctionCall ufc = (UserFunctionCall)unboundFunctionCalls.get(i);
            QueryModule importingModule = (QueryModule)correspondingStaticContext.get(i);
            correspondingStaticContext.set(i, null);    // for garbage collection purposes
            // The original UserFunctionCall is effectively a dummy: we weren't able to find a function
            // definition at the time. So we try again.
            final StructuredQName q = ufc.getFunctionName();
            final int arity = ufc.getNumberOfArguments();

            XQueryFunction fd = lib.getDeclaration(q, ufc.getArguments());
            if (fd != null) {
                fd.registerReference(ufc);
                ufc.setStaticType(fd.getResultType());
                ufc.setConfirmed(true);
                // Check that the result type and all the argument types are in the static context of the
                // calling module
                importingModule.checkImportedFunctionSignature(fd);
            } else {
                String msg = "Cannot find a matching " + arity +
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.