Package xbird.xquery.type

Examples of xbird.xquery.type.Type


        return attributeName;
    }

    @Override
    public int getXQJBaseType() throws XQException {
        final Type basetype = type;
        if(basetype == null) {
            throw new XQException("Illegal item kind: " + toString(), "err:XQJxxxx");
        }
        return basetype.getXQJBaseType();
    }
View Full Code Here


        super(SYMBOL, TypeRegistry.safeGet("xs:integer?"));
    }

    protected FunctionSignature[] signatures() {
        final FunctionSignature[] t = new FunctionSignature[2];
        Type str = TypeRegistry.safeGet("xs:string?");
        t[0] = new FunctionSignature(getName(), new Type[] { str, str });
        t[1] = new FunctionSignature(getName(), new Type[] { str, str, StringType.STRING });
        return t;
    }
View Full Code Here

        super(SYMBOL, TypeRegistry.safeGet("xs:string*"));
    }

    protected FunctionSignature[] signatures() {
        final FunctionSignature[] s = new FunctionSignature[2];
        Type strq = TypeRegistry.safeGet("xs:string?");
        s[0] = new FunctionSignature(getName(), new Type[] { strq, StringType.STRING });
        s[1] = new FunctionSignature(getName(), new Type[] { strq, StringType.STRING,
                StringType.STRING });
        return s;
    }
View Full Code Here

    }

    @Override
    public Type getReturnType(List<XQExpression> params) {
        XQExpression target = params.get(0);
        Type targetType = target.getType();
        return targetType;
    }
View Full Code Here

    public XQExpression staticAnalysis(StaticContext statEnv) throws XQueryException {
        if(!_analyzed) {
            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)) {
View Full Code Here

        super(SYMBOL, BooleanType.BOOLEAN);
    }

    protected FunctionSignature[] signatures() {
        final FunctionSignature[] s = new FunctionSignature[2];
        Type strq = TypeRegistry.safeGet("xs:string?");
        s[0] = new FunctionSignature(getName(), new Type[] { strq, StringType.STRING });
        s[1] = new FunctionSignature(getName(), new Type[] { strq, StringType.STRING,
                StringType.STRING });
        return s;
    }
View Full Code Here

                size = _exprs.size();
                ListType listtype = new ListType(size);
                for(int i = 0; i < size; i++) {
                    XQExpression analyzed = _exprs.get(i).staticAnalysis(statEnv);
                    _exprs.set(i, analyzed);
                    Type inferredType = analyzed.getType();
                    listtype.add(inferredType);
                }
                this._type = listtype;
            }
        }
View Full Code Here

    public XQExpression staticAnalysis(StaticContext statEnv) throws XQueryException {
        if(!_analyzed) {
            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)) {
View Full Code Here

     * @link http://www.w3.org/TR/xquery-semantics/#sec_convert_operand
     */
    private static AtomicValue convertOperand(final AtomicValue actual, final AtomicValue expected, final DynamicContext dynEnv)
            throws XQueryException {
        // If $actual is of type xdt:untypedAtomic, then
        final Type actualType = actual.getType();
        final Type expectedType = expected.getType();
        if(actualType == expectedType) {
            return actual;
        }
        if(actualType == UntypedAtomicType.UNTYPED_ATOMIC) {
            if(expectedType == UntypedAtomicType.UNTYPED_ATOMIC) {
View Full Code Here

    public XQExpression staticAnalysis(StaticContext statEnv) throws XQueryException {
        if(!_analyzed) {
            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);
View Full Code Here

TOP

Related Classes of xbird.xquery.type.Type

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.