Package org.apache.jackrabbit.oak.api

Examples of org.apache.jackrabbit.oak.api.CoreValue


        return "LOWER(" + operand + ')';
    }

    @Override
    public CoreValue currentValue() {
        CoreValue v = operand.currentValue();
        if (v == null) {
            return null;
        }
        String value = v.getString();
        return query.getValueFactory().createValue(value.toLowerCase());
    }
View Full Code Here


        return selectorName;
    }

    @Override
    public boolean evaluate() {
        CoreValue v = selector.currentProperty(propertyName);
        return v != null;
    }
View Full Code Here

        if (x == null) {
            x = new PropertyRestriction();
            x.propertyName = propertyName;
            propertyRestrictions.put(propertyName, x);
        }
        CoreValue oldFirst = x.first, oldLast = x.last;
        switch (op) {
        case EQUAL:
            x.first = maxValue(oldFirst, value);
            x.firstIncluding = x.first == oldFirst ? x.firstIncluding : true;
            x.last = minValue(oldLast, value);
View Full Code Here

        String propertyName = index.getName();
        Filter.PropertyRestriction restriction = filter.getPropertyRestriction(propertyName);
        if (restriction == null) {
            throw new IllegalArgumentException("No restriction for " + propertyName);
        }
        CoreValue first = restriction.first;
        String f = first == null ? null : first.toString();
        Iterator<String> it = index.getPaths(f, revisionId);
        return new ContentCursor(mk, revisionId, it);
    }
View Full Code Here

        }
    }

    @Override
    public boolean evaluate() {
        CoreValue v1 = selector1.currentProperty(property1Name);
        if (v1 == null) {
            return false;
        }
        // TODO data type mapping
        CoreValue v2 = selector2.currentProperty(property2Name);
        return v2 != null && v1.equals(v2);
    }
View Full Code Here

        return v2 != null && v1.equals(v2);
    }

    @Override
    public void apply(FilterImpl f) {
        CoreValue v1 = selector1.currentProperty(property1Name);
        CoreValue v2 = selector2.currentProperty(property2Name);
        if (f.getSelector() == selector1 && v2 != null) {
            f.restrictProperty(property1Name, Operator.EQUAL, v2);
        }
        if (f.getSelector() == selector2 && v1 != null) {
            f.restrictProperty(property2Name, Operator.EQUAL, v1);
View Full Code Here

        return operand2;
    }

    @Override
    public boolean evaluate() {
        CoreValue v1 = operand1.currentValue();
        CoreValue v2 = operand2.currentValue();
        if (v1 == null || v2 == null) {
            // TODO comparison: what about (null <> x) ?
            return false;
        }
        switch (operator) {
View Full Code Here

    }

    @Override
    public void apply(FilterImpl f) {
        CoreValue v = operand2.currentValue();
        if (v != null) {
            if (operator == Operator.LIKE) {
                String pattern;
                pattern = v.getString();
                LikePattern p = new LikePattern(pattern);
                String lowerBound = p.getLowerBound();
                String upperBound = p.getUpperBound();
                if (lowerBound == null && upperBound == null) {
                    // ignore
View Full Code Here

    }

    private String readName() throws ParseException {
        if (readIf("[")) {
            if (currentTokenType == VALUE) {
                CoreValue value = readString();
                read("]");
                return value.getString();
            } else {
                int level = 1;
                StringBuilder buff = new StringBuilder();
                while (true) {
                    if (isToken("]")) {
View Full Code Here

            StaticOperandImpl op = parseStaticOperand();
            if (!(op instanceof LiteralImpl)) {
                throw getSyntaxError("literal");
            }
            LiteralImpl literal = (LiteralImpl) op;
            CoreValue value = literal.getLiteralValue();
            read("AS");
            value = parseCastAs(value);
            read(")");
            // CastLiteral
            literal = factory.literal(value);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.api.CoreValue

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.