Package com.volantis.xml.expression

Examples of com.volantis.xml.expression.ExpressionFactory


                           Object right,
                           ValueComparator comparator) {
        boolean result = false;

        try {
            ExpressionFactory factory = getExpressionFactory();

            Sequence lseq = JXPathExpression.asValue(factory, left).
                    getSequence();
            Sequence rseq = JXPathExpression.asValue(factory, right).
                    getSequence();
View Full Code Here


     */
    static Value compute(Object left, Object right, BinaryOperator operator) {
        Value result;

        try {
            ExpressionFactory factory = getExpressionFactory();

            Sequence lseq = JXPathExpression.asValue(factory, left)
                    .getSequence();
            Sequence rseq = JXPathExpression.asValue(factory, right)
                    .getSequence();
View Full Code Here

     */
    static Value compute(Object arg, UnaryOperator operator) {
        Value result;

        try {
            ExpressionFactory factory = getExpressionFactory();

            Sequence seq = JXPathExpression.asValue(factory, arg).getSequence();

            result = PipelineExpressionHelper.compute(seq, operator);
        } catch (ExpressionException e) {
View Full Code Here

     */
    private Sequence evaluateExpression(
            final ExpressionContext expressionContext,
            String expressionAsString)
            throws ExtendedSAXException {
        ExpressionFactory factory = expressionContext.getFactory();
        ExpressionParser parser = factory.createExpressionParser();
        Sequence sequence;
        try {
            Expression expression = parser.parse(expressionAsString);
            Value value = expression.evaluate(expressionContext);
            sequence = value.getSequence();
View Full Code Here

        XMLPipelineFactory pipelineFactory = createTestable();
        // create a config
        XMLPipelineConfiguration config =
                pipelineFactory.createPipelineConfiguration();
        // get hold of an ExpressionFactory
        ExpressionFactory expressionFactory =
                pipelineFactory.getExpressionFactory();
       
        // create an expression context
        ExpressionContext expressionContext =
                expressionFactory .createExpressionContext(null, null);       
       
        // return a context
        return factory.createPipelineContext(config, expressionContext);
    }
View Full Code Here

     * Tests the {@link XMLPipelineFactory#getExpressionFactory} method.
     * @throws Exception if an error occurs.
     */
    public void testGetExpressionFactory() throws Exception {
        // retrieve the expression factory
        ExpressionFactory expressionFactory =
                factory.getExpressionFactory();
        // ensure the expression factory is of the correct type
        assertEquals("getExpressionFactory should return the default " +
                     "ExpressionFactory instance",
                     ExpressionFactory.getDefaultInstance(),
View Full Code Here

        Value result;
        if (arguments.length == 0) {
            result = Sequence.EMPTY;
        } else {
            ExpressionFactory factory = context.getFactory();

            DurationValue duration = factory.createDurationValue(
                    arguments[0].stringValue().asJavaString());
            result = getValue(factory, duration);
        }
        return result;
    }
View Full Code Here

        EnvironmentContext environmentContext = new ServletEnvironmentContext(
                requestContext);
        ContextInternals.setEnvironmentContext(requestContext,
                environmentContext);

        ExpressionFactory expressionFactory = ExpressionFactory.getDefaultInstance();

        ExpressionContext expressionContext =
                expressionFactory.createExpressionContext(
                        null,
                        NamespaceFactory.getDefaultInstance()
                        .createPrefixTracker());

        expressionContext.setProperty(MarinerRequestContext.class,
View Full Code Here

            return 0;
        }
    }
   
    public void testParameters() throws Exception {
        ExpressionFactory factory = new JXPathExpressionFactory();
        TestFunction testFunction = new TestFunction(factory);
        // @todo later fix parameters
        ExpressionContext context = factory.createExpressionContext(null, null);
        JXPathExpressionFunctionAdapter adapter =
                new JXPathExpressionFunctionAdapter(factory,
                                                    testFunction,
                                                    context);
        Item[] items = {factory.createIntValue(1),
                        factory.createIntValue(2),
                        factory.createStringValue("3")};
        int[] ints = {42, 255, 7};
        String[] strings = {"ho", "ho", "little", "boy"};
        Object[] paramList = {new Integer(0),
                              "fred",
                              new Double(2.4),
                              new String(),
                              new Boolean(true),
                              factory.createBooleanValue(false),
                              factory.createSequence(items),
                              factory.createStringValue("abc"),
                              ints,
                              strings,
                              items};
        Value result = (Value)adapter.invoke(
            new TestExpressionContext(), paramList);
View Full Code Here

        Dependency dependency = new TestDependency(cacheability, timeToLive,
                freshness, revalidated);
        DependencyContext dependencyContext = context.getDependencyContext();
        dependencyContext.addDependency(dependency);

        ExpressionFactory factory = context.getFactory();
        return factory.createStringValue("freshness = " + freshness + ", " +
                "revalidate = " + revalidated + ", " +
                "cacheable = " + cacheable + ", " +
                "time-to-live = " + timeToLive);
    }
View Full Code Here

TOP

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

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.