Package xbird.xquery.type.Type

Examples of xbird.xquery.type.Type.Occurrence.accepts()


    }

    public static boolean instanceOf(final Sequence<? extends Item> value, final Type type) {
        final Occurrence occ = type.quantifier();
        if(value.isEmpty()) {
            return occ.accepts(Occurrence.OCC_ZERO.getAlignment());
        }
        final Type expected = (type instanceof SequenceType) ? ((SequenceType) type).prime() : type;
        int count = 0;
        final IFocus<? extends Item> valueItor = value.iterator();
        for(Item it : valueItor) {
View Full Code Here


        valueItor.closeQuietly();
        if(count == 0) {
            throw new IllegalStateException();
        }
        if(count == 1) {
            return occ.accepts(Occurrence.OCC_EXACTLY_ONE.getAlignment());
        } else {
            return occ.accepts(Occurrence.OCC_MORE.getAlignment());
        }
    }
View Full Code Here

            throw new IllegalStateException();
        }
        if(count == 1) {
            return occ.accepts(Occurrence.OCC_EXACTLY_ONE.getAlignment());
        } else {
            return occ.accepts(Occurrence.OCC_MORE.getAlignment());
        }
    }

    public static Type union(final Type baseType, final Type type) {
        if(baseType instanceof ChoiceType) {
View Full Code Here

                final List<XQExpression> params = funcall.getParams();
                if(params.size() == 1) {
                    FunctionSignature sig = funcall.getFunction().getFunctionSignature(1);
                    Type type = sig.getArgumentType(0);
                    Occurrence occ = type.quantifier();
                    if(!occ.accepts(Occurrence.OCC_ZERO_OR_MORE.getAlignment())) {
                        return flwr; //TODO REVIEWME
                    }
                    final XQExpression firstArg = params.get(0);
                    final XQExpression cutted = recApplyFLWRCuttingInternal(flwr, firstArg);
                    if(cutted != flwr) {
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.