Package com.volantis.xml.expression

Examples of com.volantis.xml.expression.Value


                pipelineContext.getExpressionContext();

        Expression expression =
                expressionFactory.createExpressionParser().parse(
                    expressionString);
        Value result = expression.evaluate(expressionContext);
        return PipelineExpressionHelper.fnBoolean(result.getSequence())
                .asJavaBoolean();
    }
View Full Code Here


    public void testEmptySequenceInput() throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = Sequence.EMPTY;
        Value search = factory.createStringValue("a");
        Value retVal = tokenize.invoke(context, new Value[]{sequence, search});

        final Sequence retSeq = retVal.getSequence();

        // Should have returned ()
        assertSame(retSeq, Sequence.EMPTY);
    }
View Full Code Here

        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{""});
        Value search = factory.createStringValue("a");
        Value retVal = tokenize.invoke(context, new Value[]{sequence, search});

        final Sequence retSeq = retVal.getSequence();

        // Should have returned ()
        assertSame(retSeq, Sequence.EMPTY);
    }
View Full Code Here

        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{"my search string"});
        Value pattern = factory.createStringValue("");
        try {
            Value retVal = tokenize.invoke(context,
                    new Value[]{sequence, pattern});
            fail("An empty pattern should result in an ExpressionException");
        } catch (ExpressionException ee) {
            // This exception is expected
        }
View Full Code Here

        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{"abcdefghicat"});
        Value pattern = factory.createStringValue("abc");
        Value retVal = tokenize.invoke(context,
                new Value[]{sequence, pattern});

        final Sequence retSeq = retVal.getSequence();

        doSequenceEquality(retSeq, new String[]{"", "defghicat"});
    }
View Full Code Here

        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{"abcdefghicat"});
        Value pattern = factory.createStringValue("cat");
        Value retVal = tokenize.invoke(context,
                new Value[]{sequence, pattern});

        final Sequence retSeq = retVal.getSequence();

        doSequenceEquality(retSeq, new String[]{"abcdefghi", ""});
    }
View Full Code Here

        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{"the cat  sat   on    the     mat"});
        Value pattern = factory.createStringValue("\\s+");
        Value retVal = tokenize.invoke(context,
                new Value[]{sequence, pattern});

        final Sequence retSeq = retVal.getSequence();

        doSequenceEquality(retSeq,
                new String[]{"the", "cat", "sat", "on", "the", "mat"});
    }
View Full Code Here

        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{"thexcat,x,xxxsatxxxxon,thexxxxxmat"});
        Value pattern = factory.createStringValue(",x");
        Value retVal = tokenize.invoke(context,
                new Value[]{sequence, pattern});

        final Sequence retSeq = retVal.getSequence();

        doSequenceEquality(retSeq,
                new String[]{"thexcat", "", "xxsatxxxxon,thexxxxxmat"});
    }
View Full Code Here

        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{"one big long missspelt sentence"});
        Value pattern =
                factory.createStringValue("one big long missspelt sentence");
        Value retVal = tokenize.invoke(context,
                new Value[]{sequence, pattern});

        final Sequence retSeq = retVal.getSequence();

        doSequenceEquality(retSeq, new String[]{""});
    }
View Full Code Here

        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{"xxxxxxxxxx"});
        Value pattern = factory.createStringValue("x");
        Value retVal = tokenize.invoke(context,
                new Value[]{sequence, pattern});

        final Sequence retSeq = retVal.getSequence();

        doSequenceEquality(retSeq,
                new String[]{"", "", "", "", "", "", "", "", "", "", ""});
    }
View Full Code Here

TOP

Related Classes of com.volantis.xml.expression.Value

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.