Package org.modeshape.jcr.query.xpath.XPath

Examples of org.modeshape.jcr.query.xpath.XPath.NameTest.matches()


                assert operandBuilder != null;
                if (spec.getAttributeName() != null) {
                    // This order by is defined by an attribute ...
                    NameTest attribute = spec.getAttributeName();
                    assert !attribute.isWildcard();
                    if (attribute.matches("jcr", "path")) {
                        String pathOf = tableName;
                        if (pathOf == null) pathOf = aliases.iterator().next();
                        operandBuilder.path(pathOf);
                    } else {
                        operandBuilder.propertyValue(tableName, attribute.toString());
View Full Code Here


            } else if (left instanceof FunctionCall && right instanceof Literal) {
                FunctionCall call = (FunctionCall)left;
                NameTest functionName = call.getName();
                List<Component> parameters = call.getParameters();
                String value = ((Literal)right).getValue();
                if (functionName.matches("jcr", "score")) {
                    String scoreTableName = tableName;
                    if (parameters.isEmpty()) {
                        scoreTableName = tableName;
                    } else if (parameters.size() == 1 && parameters.get(0) instanceof NameTest) {
                        // The first parameter can be the type name (or table name) ...
View Full Code Here

            FunctionCall call = (FunctionCall)predicate;
            NameTest functionName = call.getName();
            List<Component> parameters = call.getParameters();
            Component param1 = parameters.size() > 0 ? parameters.get(0) : null;
            Component param2 = parameters.size() > 1 ? parameters.get(1) : null;
            if (functionName.matches(null, "not")) {
                if (parameters.size() != 1) {
                    throw new InvalidQueryException(query, "The 'not' function requires one parameter; therefore '" + predicate
                                                           + "' is not valid");
                }
                where = where.not().openParen();
View Full Code Here

                                                           + "' is not valid");
                }
                where = where.not().openParen();
                translatePredicate(param1, tableName, where);
                where.closeParen();
            } else if (functionName.matches("jcr", "like")) {
                if (parameters.size() != 2) {
                    throw new InvalidQueryException(query, "The 'jcr:like' function requires two parameters; therefore '"
                                                           + predicate + "' is not valid");
                }
                if (!(param2 instanceof Literal)) {
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.