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

Examples of org.modeshape.jcr.query.xpath.XPath.NameTest


                                         Component... parameters ) {
        return new FunctionCall(name, Arrays.asList(parameters));
    }

    protected NameTest wildcard() {
        return new NameTest(null, null);
    }
View Full Code Here


    protected NameTest wildcard() {
        return new NameTest(null, null);
    }

    protected NameTest nameTest( String localPart ) {
        return new NameTest(null, localPart);
    }
View Full Code Here

        return new NameTest(null, localPart);
    }

    protected NameTest nameTest( String prefix,
                                 String local ) {
        return new NameTest(prefix, local);
    }
View Full Code Here

        if (removeQuotes) value = removeQuotes(value);
        return new Literal(value);
    }

    protected FunctionCall parseFunctionCall( TokenStream tokens ) {
        NameTest name = parseQName(tokens);
        tokens.consume("(");
        List<Component> args = new ArrayList<Component>();
        if (!tokens.matches(')')) {
            do {
                args.add(collapse(parseExprSingle(tokens)));
View Full Code Here

        if (kind != null) return kind;
        return parseNameTest(tokens);
    }

    protected NameTest parseNameTest( TokenStream tokens ) {
        NameTest wildcard = parseWildcard(tokens);
        if (wildcard != null) return wildcard;
        return parseQName(tokens);
    }
View Full Code Here

    protected NameTest parseQName( TokenStream tokens ) {
        String firstPart = parseNCName(tokens);
        if (tokens.canConsume(':')) {
            String secondPart = tokens.consume();
            return new NameTest(decode(firstPart), decode(secondPart));
        }
        return new NameTest(null, decode(firstPart));
    }
View Full Code Here

    protected NameTest parseWildcard( TokenStream tokens ) {
        if (tokens.canConsume('*')) {
            if (tokens.canConsume(':')) {
                if (tokens.canConsume('*')) {
                    return new NameTest(null, null);
                }
                String localName = tokens.consume();
                return new NameTest(null, decode(localName));
            }
            return new NameTest(null, null);
        }
        if (tokens.matches(XPathTokenizer.NAME, XPathTokenizer.SYMBOL, XPathTokenizer.SYMBOL)
            && tokens.matches(TokenStream.ANY_VALUE, ":", "*")) {
            String prefix = tokens.consume();
            tokens.consume(':');
            tokens.consume('*');
            return new NameTest(decode(prefix), null);
        }
        return null;
    }
View Full Code Here

    }

    protected ElementTest parseElementTest( TokenStream tokens ) {
        if (tokens.canConsume("element", "(")) {
            if (tokens.canConsume(")") || tokens.canConsume("*", ")")) {
                return new ElementTest(new NameTest(null, null), new NameTest(null, null));
            }
            ElementTest result = null;
            NameTest elementName = parseNameTest(tokens);
            if (tokens.canConsume(",")) {
                NameTest typeName = parseNameTest(tokens);
                result = new ElementTest(elementName, typeName);
                tokens.canConsume('?'); // just eat this
            } else {
                result = new ElementTest(elementName, new NameTest(null, null));
            }
            tokens.consume(")");
            return result;
        }
        return null;
View Full Code Here

        return null;
    }

    protected SchemaElementTest parseSchemaElementTest( TokenStream tokens ) {
        if (tokens.canConsume("schema-element", "(")) {
            NameTest elementDeclarationName = parseNameTest(tokens);
            SchemaElementTest result = new SchemaElementTest(elementDeclarationName);
            tokens.consume(")");
            return result;
        }
        return null;
View Full Code Here

    }

    protected AttributeTest parseAttributeTest( TokenStream tokens ) {
        if (tokens.canConsume("attribute", "(")) {
            if (tokens.canConsume(")") || tokens.canConsume("*", ")")) {
                return new AttributeTest(new NameTest(null, null), new NameTest(null, null));
            }
            AttributeTest result = null;
            NameTest attributeName = parseNameTest(tokens);
            if (tokens.canConsume(",")) {
                NameTest typeName = parseNameTest(tokens);
                result = new AttributeTest(attributeName, typeName);
            } else {
                result = new AttributeTest(attributeName, new NameTest(null, null));
            }
            tokens.consume(")");
            return result;
        }
        return null;
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.query.xpath.XPath.NameTest

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.