Package org.modeshape.jcr.query.model

Examples of org.modeshape.jcr.query.model.Length.selectorName()


            if (replacement == null) return operand;
            return new Length(new PropertyValue(replacement, wrapped.getPropertyName()));
        }
        if (operand instanceof LowerCase) {
            LowerCase operation = (LowerCase)operand;
            SelectorName replacement = rewrittenSelectors.get(operation.selectorName());
            if (replacement == null) return operand;
            return new LowerCase(replaceReferencesToRemovedSource(context, operation.getOperand(), rewrittenSelectors));
        }
        if (operand instanceof UpperCase) {
            UpperCase operation = (UpperCase)operand;
View Full Code Here


            if (replacement == null) return operand;
            return new LowerCase(replaceReferencesToRemovedSource(context, operation.getOperand(), rewrittenSelectors));
        }
        if (operand instanceof UpperCase) {
            UpperCase operation = (UpperCase)operand;
            SelectorName replacement = rewrittenSelectors.get(operation.selectorName());
            if (replacement == null) return operand;
            return new UpperCase(replaceReferencesToRemovedSource(context, operation.getOperand(), rewrittenSelectors));
        }
        if (operand instanceof NodeName) {
            NodeName name = (NodeName)operand;
View Full Code Here

        DynamicOperand operand = parser.parseDynamicOperand(tokens("LENGTH(tableA.property)"), typeSystem, mock(Source.class));
        assertThat(operand, is(instanceOf(Length.class)));
        Length length = (Length)operand;
        assertThat(length.getPropertyValue().getPropertyName(), is("property"));
        assertThat(length.getPropertyValue().selectorName(), is(selectorName("tableA")));
        assertThat(length.selectorName(), is(selectorName("tableA")));

        Source source = new NamedSelector(selectorName("tableA"));
        operand = parser.parseDynamicOperand(tokens("LENGTH(property)"), typeSystem, source);
        assertThat(operand, is(instanceOf(Length.class)));
        length = (Length)operand;
View Full Code Here

        operand = parser.parseDynamicOperand(tokens("LENGTH(property)"), typeSystem, source);
        assertThat(operand, is(instanceOf(Length.class)));
        length = (Length)operand;
        assertThat(length.getPropertyValue().getPropertyName(), is("property"));
        assertThat(length.getPropertyValue().selectorName(), is(selectorName("tableA")));
        assertThat(length.selectorName(), is(selectorName("tableA")));
    }

    @Test( expected = ParsingException.class )
    public void shouldFailToParseDynamicOperandFromStringContainingLengthWithoutClosingParenthesis() {
        parser.parseDynamicOperand(tokens("LENGTH(tableA.property other"), typeSystem, mock(Source.class));
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.