Package org.apache.jackrabbit.oak.api

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


        }
        return -1;
    }

    public PropertyValue getBindVariableValue(String bindVariableName) {
        PropertyValue v = bindVariableMap.get(bindVariableName);
        if (v == null) {
            throw new IllegalArgumentException("Bind variable value not set: " + bindVariableName);
        }
        return v;
    }
View Full Code Here


        return Collections.singleton(selector);
    }

    @Override
    public PropertyValue currentProperty() {
        PropertyValue p = selector.currentOakProperty(QueryImpl.JCR_SCORE);
        if (p == null) {
            // TODO if score() is not supported by the index, use the value 0.0?
            return PropertyValues.newDouble(0.0);
        }
        return p;
View Full Code Here

        PropertyValue[] values = row.getValues();
        for (int i = 0; i < values.length; i++) {
            if (i > 0) {
                buff.append(", ");
            }
            PropertyValue v = values[i];
            buff.append(v == null ? "null" : v.getValue(Type.STRING));
        }
        return buff.toString();
    }
View Full Code Here

                if (readIf("ESCAPE")) {
                    StaticOperandImpl esc = parseStaticOperand();
                    if (!(esc instanceof LiteralImpl)) {
                        throw getSyntaxError("only ESCAPE '\' is supported");
                    }
                    PropertyValue v = ((LiteralImpl) esc).getLiteralValue();
                    if (!v.getValue(Type.STRING).equals("\\")) {
                        throw getSyntaxError("only ESCAPE '\' is supported");
                    }
                }
            }
        } else if (readIf("IN")) {
View Full Code Here

            StaticOperandImpl op = parseStaticOperand();
            if (!(op instanceof LiteralImpl)) {
                throw getSyntaxError("literal");
            }
            LiteralImpl literal = (LiteralImpl) op;
            PropertyValue value = literal.getLiteralValue();
            read("AS");
            value = parseCastAs(value);
            read(")");
            // CastLiteral
            literal = factory.literal(value);
            return literal;
        } else {
            if (supportSQL1) {
                if (readIf("TIMESTAMP")) {
                    StaticOperandImpl op = parseStaticOperand();
                    if (!(op instanceof LiteralImpl)) {
                        throw getSyntaxError("literal");
                    }
                    LiteralImpl literal = (LiteralImpl) op;
                    PropertyValue value = literal.getLiteralValue();
                    value = PropertyValues.newDate(value.getValue(Type.DATE));
                    literal = factory.literal(value);
                    return literal;
                }
            }
            throw getSyntaxError("static operand");
View Full Code Here

            throw getSyntaxError("data type (STRING|BINARY|...)");
        }
        int propertyType = getPropertyTypeFromName(currentToken);
        read();

        PropertyValue v = PropertyValues.convert(value, propertyType, null);
        if (v == null) {
            throw getSyntaxError("data type (STRING|BINARY|...)");
        }
        return v;
    }
View Full Code Here

    private PropertyValue readString() throws ParseException {
        if (currentTokenType != VALUE) {
            throw getSyntaxError("string value");
        }
        PropertyValue value = currentValue;
        read();
        return value;
    }
View Full Code Here

public class FilterTest {

    @Test
    public void propertyRestriction() {

        PropertyValue one = PropertyValues.newString("1");
        PropertyValue two = PropertyValues.newString("2");

        FilterImpl f = new FilterImpl();
        assertTrue(null == f.getPropertyRestriction("x"));
        f.restrictProperty("x", Operator.LESS_OR_EQUAL, two);
        assertEquals("..2]", f.getPropertyRestriction("x").toString());
View Full Code Here

        return value;
    }
   
    @Override
    int getPropertyType() {
        PropertyValue v = currentValue();
        return v == null ? PropertyType.UNDEFINED : v.getType().tag();
    }
View Full Code Here

            public int compare(ResultRowImpl o1, ResultRowImpl o2) {
                PropertyValue[] orderValues = o1.getOrderValues();
                PropertyValue[] orderValues2 = o2.getOrderValues();
                int comp = 0;
                for (int i = 0, size = orderings.length; i < size; i++) {
                    PropertyValue a = orderValues[i];
                    PropertyValue b = orderValues2[i];
                    if (a == null || b == null) {
                        if (a == b) {
                            comp = 0;
                        } else if (a == null) {
                            // TODO order by: nulls first (it looks like), or
View Full Code Here

TOP

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

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.