Package xbird.xquery

Examples of xbird.xquery.XQueryException


        final Grid grid = connectToGrid(true);
        final Sequence<? extends Item> result;
        try {
            result = grid.execute(MapQueryJob.class, this);
        } catch (RemoteException e) {
            throw new XQueryException(e.getMessage(), e);
        }
        return result;
    }
View Full Code Here


        if(_remoteEndpoint != null) {
            try {
                executeAt(reader, writer, _remoteEndpoint);
            } catch (IOException e) {
                throw new XQueryException("Caused an IO error", e);
            }
        } else {
            XQueryModule xqmod = new XQueryModule();
            XQueryProcessor proc = new XQueryProcessor(xqmod);
            XQueryModule module = proc.parse(reader, getBaseUri());
View Full Code Here

        QueryRequest request = new QueryRequest(query, ReturnType.ASYNC_REMOTE_SEQUENCE);
        final Sequence<Item> resultSeq;
        try {
            resultSeq = (Sequence<Item>) engine.execute(request);
        } catch (RemoteException e) {
            throw new XQueryException("failed to execute a query", e);
        }

        SAXWriter saxwr = prepareSAXWriter(writer);
        Serializer ser = new SAXSerializer(saxwr, writer);
        ser.emit(resultSeq);
View Full Code Here

        for(FunctionSignature sig : signs) {
            if(sig.getArity() == arity) {
                return sig;
            }
        }
        throw new XQueryException("Function " + _funcName.getLocalPart() + " of arity " + arity
                + " not found");
    }
View Full Code Here

        } catch (TokenMgrError tme) {
            throw new SyntaxError("err:XPST0003", getErrorMessage(tme, false), tme);
        } catch (ParseException pe) {
            throw new SyntaxError("err:XPST0003", getErrorMessage(pe, false), pe);
        } catch (Throwable e) {
            throw new XQueryException(getErrorMessage(e, true), e);
        }
        return m;
    }
View Full Code Here

        }

        Variable declareGlobalVariable(QualifiedName varName, XQExpression value)
                throws XQueryException {
            if(vars.containsKey(varName)) {
                throw new XQueryException("err:XQST0049", "Variable already defined: " + varName);
            }
            Variable v = new GlobalVariable(varName, value);
            vars.put(varName, v);
            localVars.add(varName);
            return v;
View Full Code Here

        void putVariable(QualifiedName varName, Variable variable) throws XQueryException {
            if(variable instanceof GlobalVariable) {
                Variable var = vars.get(varName);
                if(var != null && !(var instanceof ExternalVariable)) {
                    throw new XQueryException("err:XQ0049", "Duplicate global variable: " + varName);
                }
            } else {
                if(localVars.contains(varName)) {
                    throw new XQueryException("err:XQ0049", "Duplicate local variable: " + varName);
                }
            }
            vars.put(varName, variable);
            localVars.add(varName);
        }
View Full Code Here

            if(prefix.length() == 0) {
                throw new IllegalArgumentException("Invalid QName expression: " + qname);
            }
            namespaceURI = namespaceContext.getNamespaceURI(prefix);
            if(namespaceURI == null) {
                throw new XQueryException("err:XPST0081", "invalid namespace prefix: " + prefix);
            }
        }
        return QNameTable.instantiate(namespaceURI, localPart, prefix);
    }
View Full Code Here

        if(sigs.length == 0) {
            throw new IllegalStateException("Function does not have signatures.");
        }
        for(int i = 0; i < sigs.length; i++) {
            if(functions.containsKey(sigs[i])) {
                throw new XQueryException("err:XQST0034", "Function already defined: "
                        + func.getName());
            }
            functions.put(sigs[i], func);
        }
    }
View Full Code Here

            if(_catchedException != null) {
                throw _catchedException;
            }
            final Sequence result = _result;
            if(result == null) {
                throw new XQueryException("Result of ThreadedVariable#" + getName()
                        + " was illegally null");
            }
            return result;
        } finally {
            lock.unlock();
View Full Code Here

TOP

Related Classes of xbird.xquery.XQueryException

Copyright © 2018 www.massapicom. 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.