Package org.jboss.dna.jcr.xpath.XPath

Examples of org.jboss.dna.jcr.xpath.XPath.NameTest.matches()


            } 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 (!(param1 instanceof AttributeNameTest)) {
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.