Package xbird.xquery

Examples of xbird.xquery.TypeError


            return expr;
        } else {
            if(TypeUtil.isPromotable(srcType, destType)) {
                return new TypePromotedExpr(expr, destType, true);
            } else {
                throw new TypeError("err:XPTY0004", "Declared type '" + destType
                        + "' does not accept inferred type '" + srcType + "': \n" + expr);
            }
        }
    }
View Full Code Here


        for(int i = 0; i < arity; i++) {
            Type expected = expectedTypes[i];
            XQExpression expr = params.get(i);
            Type actual = expr.getType();
            if(!TypeUtil.subtypeOf(actual, expected)) {// REVIEWME ok
                throw new TypeError("err:XPTY0004", i + "th parameter type '" + actual
                        + "' does not match to the expected argument type '" + expected + '\'');
            }
        }
        return this;
    }
View Full Code Here

                if(nodekind == NodeKind.ATTRIBUTE) {
                    if(!prevAttr) {
                        itor.closeQuietly();
                        // If the content sequence contains an attribute node
                        // following a node that is not an attribute node, a type error is raised [err:XQTY0024].
                        throw new TypeError("err:XQTY0024", "An attribute node in the content sequence is not allowed: "
                                + content.getType());
                    }
                    DMAttribute attr = new DMAttribute(dmnode.getPosition(), dmnode.nodeName(), dmnode.getContent());
                    addAttribute(attr);
                    prevTxt = null;
View Full Code Here

                            prevText = null;
                        }
                        nodes.addItem(c);
                    }
                } else if(nodekind == NodeKind.ATTRIBUTE) {
                    throw new TypeError("err:XPTY0004", "An attribute node in the content sequence is not allowed: "
                            + i);
                } else {
                    DMNode c = dmnode.clone();
                    if(nodekind == NodeKind.TEXT) {
                        String curText = c.getContent();
View Full Code Here

            this._analyzed = true;
            this._leftOperand = _leftOperand.staticAnalysis(statEnv);
            this._rightOperand = _rightOperand.staticAnalysis(statEnv);
            final Type ltype = _leftOperand.getType();
            if(!TypeUtil.subtypeOf(ltype, _type)) {
                throw new TypeError("Inferred type of left operand is invalid: "
                        + _leftOperand.getType());
            }
            if(!TypeUtil.subtypeOf(_rightOperand.getType(), _type)) {
                throw new TypeError("Inferred type of left operand is invalid: "
                        + _rightOperand.getType());
            }
            this._type = ltype;
        }
        return this;
View Full Code Here

            this._analyzed = true;
            this._leftOperand = _leftOperand.staticAnalysis(statEnv);
            this._rightOperand = _rightOperand.staticAnalysis(statEnv);
            final Type ltype = _leftOperand.getType();
            if(!TypeUtil.subtypeOf(ltype, _type)) {
                throw new TypeError("Inferred type of left operand is invalid: "
                        + _leftOperand.getType());
            }
            if(!TypeUtil.subtypeOf(_rightOperand.getType(), _type)) {
                throw new TypeError("Inferred type of left operand is invalid: "
                        + _rightOperand.getType());
            }
            this._type = ltype;
        }
        return this;
View Full Code Here

            this._analyzed = true;
            this._leftOperand = _leftOperand.staticAnalysis(statEnv);
            this._rightOperand = _rightOperand.staticAnalysis(statEnv);
            final Type ltype = _leftOperand.getType();
            if(!TypeUtil.subtypeOf(ltype, _type)) {
                throw new TypeError("Inferred type of left operand is invalid: "
                        + _leftOperand.getType());
            }
            final Type rtype = _rightOperand.getType();
            if(!TypeUtil.subtypeOf(rtype, _type)) {
                throw new TypeError("Inferred type of left operand is invalid: "
                        + _rightOperand.getType());
            }
            this._type = TypeUtil.union(ltype, rtype);
        }
        return this;
View Full Code Here

            this._analyzed = true;
            this._leftOperand = _leftOperand.staticAnalysis(statEnv);
            this._rightOperand = _rightOperand.staticAnalysis(statEnv);
            final Type integerType = TypeRegistry.safeGet("xs:integer?");
            if(!TypeUtil.subtypeOf(_leftOperand.getType(), integerType)) {
                throw new TypeError("Inferred type of left operand is invalid: "
                        + _leftOperand.getType());
            }
            if(!TypeUtil.subtypeOf(_rightOperand.getType(), integerType)) {
                throw new TypeError("Inferred type of left operand is invalid: "
                        + _rightOperand.getType());
            }
        }
        return this;
    }
View Full Code Here

        if(!_analyzed) {
            this._analyzed = true;
            this._leftOperand = _leftOperand.staticAnalysis(statEnv);
            this._rightOperand = _rightOperand.staticAnalysis(statEnv);
            if(!TypeUtil.subtypeOf(_leftOperand.getType(), _type)) {
                throw new TypeError("Inferred type of left operand is invalid: "
                        + _leftOperand.getType());
            }
            if(!TypeUtil.subtypeOf(_rightOperand.getType(), _type)) {
                throw new TypeError("Inferred type of left operand is invalid: "
                        + _rightOperand.getType());
            }
        }
        return this;
    }
View Full Code Here

        if(expr == null) {
            throw new IllegalArgumentException();
        }
        if(expr instanceof AttributeConstructorBase) {
            if(!contents.isEmpty()) {
                throw new TypeError("err:XQTY0024", "an attribute node following a node that is not an attribute node");
            }
            AttributeConstructorBase att = (AttributeConstructorBase) expr;
            if(att instanceof NamespaceConstructor) {
                attributes.add(0, att);
                ++_attslen;
View Full Code Here

TOP

Related Classes of xbird.xquery.TypeError

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.