Package com.volantis.xml.expression

Examples of com.volantis.xml.expression.ExpressionContext


            envTracker.pushEnvironmentInteraction(environmentInteraction);
        }

        // factor an Expression context passing in both the Environment
        // Interaction and Namespace prefix trackers
        ExpressionContext expressionContext =
                wrapper.getExpressionFactory().
                createExpressionContext(envTracker, namespaceTracker);

        // Construct and return  XMLPipelineContextImpl
        // using the arguments provided
View Full Code Here


            throws ExpressionException {

        ExpressionFactory expressionFactory =
                ExpressionFactory.getDefaultInstance();

        ExpressionContext expressionContext =
                pipelineContext.getExpressionContext();

        Expression expression =
                expressionFactory.createExpressionParser().parse(
                    expressionString);
View Full Code Here

        TValue value = model.getParameterBlock().query(parameter);

        XMLPipelineContext pipelineContext = dynamicProcess.getPipelineContext();

        ExpressionContext context = pipelineContext.getExpressionContext();

        // The given name could be a prefixed name, so go through these
        // hoops to ensure that we register the variable against the
        // correct namespace (the namespace for no prefix is "no namespace"
        // according to http://www.w3.org/TR/xpath20/#id-variables - this
        // is modelled using the "default namespace" for variables)
        NamespacePrefixTracker namespacePrefixTracker =
                context.getNamespacePrefixTracker();
        ExpandedName name = namespacePrefixTracker.resolveQName(
                new ImmutableQName(variable), "");

        // Create a new TemplateExpressionValue
        TemplateExpressionValue initialValue = new TemplateExpressionValue(
View Full Code Here

                    Expression expression = parser.parse(value);

                    // obtain the ExpressionContext from the PipelineContext
                    // the ExpressionContext is needed in order to evaluate the
                    // expression parsed
                    ExpressionContext expressionContext =
                            pipelineContext.getExpressionContext();

                    // Evaluate the expression and cast to a boolean.
                    boolean result = PipelineExpressionHelper.fnBoolean(
                            expression.evaluate(
View Full Code Here

    /**
     * Tests the empty sequence input gives an empty sequence result.
     */
    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});

View Full Code Here

    /**
     * Tests the empty string input gives an empty sequence result.
     */
    public void testEmptyStringInput() throws Exception {
        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});
View Full Code Here

    /**
     * Tests that the empty pattern throws an ExpressionException.
     */
    public void testEmptyPattern() throws Exception {
        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 {
View Full Code Here

    /**
     * Tests that pattern at start gives an empty string token at start.
     */
    public void testStartsWithPattern() throws Exception {
        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,
View Full Code Here

    /**
     * Tests that pattern at end gives an empty string token at end.
     */
    public void testEndsWithPattern() throws Exception {
        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,
View Full Code Here

    /**
     * Tests a regexp whitespace pattern.
     */
    public void testWhitespacePattern() throws Exception {
        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,
View Full Code Here

TOP

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

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.