Package org.apache.jackrabbit.spi.commons.query.jsr283.qom

Examples of org.apache.jackrabbit.spi.commons.query.jsr283.qom.PropertyValue


        }
        return a;
    }

    private Constraint parseAnd() throws RepositoryException {
        Constraint a = parseCondition();
        while (readIf("AND")) {
            a = factory.and(a, parseCondition());
        }
        return a;
    }
View Full Code Here


        return a;
    }

    // Page 138
    private Constraint parseCondition() throws RepositoryException {
        Constraint a;
        if (readIf("NOT")) {
            a = parseConstraint();
        } else if (readIf("(")) {
            a = parseConstraint();
            read(")");
View Full Code Here

        return a;
    }

    // Page 141
    private Constraint parseCondition(DynamicOperand left) throws RepositoryException {
        Constraint c;
        if (readIf("=")) {
            c = factory.comparison(left,
                    QueryObjectModelConstants.OPERATOR_EQUAL_TO,
                    parseStaticOperand());
        } else if (readIf("<>")) {
View Full Code Here

        }
    }

    // Page 144
    private Constraint parseConditionFuntionIf(String functionName) throws RepositoryException {
        Constraint c;
        if ("CONTAINS".equals(functionName)) {
            String name = readName();
            if (readIf(".")) {
                if (readIf("*")) {
                    read(",");
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#descendantNode(String)}
     */
    public void testDescendantNode() throws RepositoryException {
        DescendantNode descNode = qomFactory.descendantNode(testRootNode.getPath());
        assertNull("Selector must be null", descNode.getSelectorName());
        assertEquals("Wrong path", testRootNode.getPath(), descNode.getPath());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#descendantNode(String, String)}
     */
    public void testDescendantNodeWithSelector() throws RepositoryException {
        DescendantNode descNode = qomFactory.descendantNode(SELECTOR_NAME1, testRootNode.getPath());
        assertEquals("Wrong selector name", SELECTOR_NAME1, descNode.getSelectorName());
        assertEquals("Wrong path", testRootNode.getPath(), descNode.getPath());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#descendantNodeJoinCondition(String, String)}
     */
    public void testDescendantNodeJoinCondition() throws RepositoryException {
        DescendantNodeJoinCondition cond = qomFactory.descendantNodeJoinCondition(SELECTOR_NAME1, SELECTOR_NAME2);
        assertEquals("Wrong selector name", SELECTOR_NAME1, cond.getDescendantSelectorName());
        assertEquals("Wrong selector name", SELECTOR_NAME2, cond.getAncestorSelectorName());
    }
View Full Code Here

        } else if (currentTokenType == IDENTIFIER) {
            String identifier = readName();
            if (readIf("(")) {
                a = parseConditionFuntionIf(identifier);
                if (a == null) {
                    DynamicOperand op = parseExpressionFunction(identifier);
                    a = parseCondition(op);
                }
            } else if (readIf(".")) {
                a = parseCondition(factory.propertyValue(identifier, readName()));
            } else {
View Full Code Here

            return parsePropertyValue(name);
        }
    }

    private DynamicOperand parseExpressionFunction(String functionName) throws RepositoryException {
        DynamicOperand op;
        if ("LENGTH".equals(functionName)) {
            op = factory.length(parsePropertyValue(readName()));
        } else if ("NAME".equals(functionName)) {
            if (isToken(")")) {
                op = factory.nodeName();
View Full Code Here

    // Page 157
    private Ordering[] parseOrder() throws RepositoryException {
        ArrayList orderList = new ArrayList();
        do {
            Ordering ordering;
            DynamicOperand op = parseDynamicOperand();
            if (readIf("DESC")) {
                ordering = factory.descending(op);
            } else {
                readIf("ASC");
                ordering = factory.ascending(op);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.commons.query.jsr283.qom.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.