Package org.apache.velocity.app

Examples of org.apache.velocity.app.VelocityEngine.evaluate()


        VelocityContext velocityContext = new VelocityContext();

        velocityContext.put("test1", "@test1@");
        velocityContext.put("test2", "@test2@");

        assertTrue(engine.evaluate(velocityContext, writer, "mylogtag", "$test1$test2"));
        assertEquals(
            "@test1@@test2@",
            writer.getBuffer().toString());
    }
   
View Full Code Here


         * Eventually, it'd be nice to utilize some AST caching here.
         * But that will likely need to wait until the StringResourceLoader
         * is ready for general use (Velocity 1.6), unless we want to
         * duplicate that minimally here in Tools 2.0
         */
        engine.evaluate(getViewToolContext(), out, getId(),
                        getBodyContent().getReader());
    }

    protected static int toScopeInt(String scope)
    {
View Full Code Here

        // let velocity parse and generate the result in buffer
        VelocityEngine engine = getVelocityEngine();
        if (log.isDebugEnabled()) {
            log.debug("Velocity is evaluating using velocity context: " + variableMap);
        }
        engine.evaluate(velocityContext, buffer, logTag, reader);

        // now lets output the results to the exchange
        Message out = exchange.getOut(true);
        out.setBody(buffer.toString());
        out.setHeader("org.apache.camel.velocity.resource", resource);
View Full Code Here

         * Eventually, it'd be nice to utilize some AST caching here.
         * But that will likely need to wait until the StringResourceLoader
         * is ready for general use (Velocity 1.6), unless we want to
         * duplicate that minimally here in Tools 2.0
         */
        engine.evaluate(getViewToolContext(), out, getId(),
                        getBodyContent().getReader());
    }

    protected static int toScopeInt(String scope)
    {
View Full Code Here

        //-- raise event --//
        super.doEvent(new OnBeforeEvaluate(this, context));
        //-- evaluate template --//
        final VelocityEngine engine = this.getNativeEngine();
        final StringWriter writer = new StringWriter();
        engine.evaluate(context, writer, templateName, vlcText);

        return this.replaceUnsolvedVariables(writer.toString());
    }
    // ------------------------------------------------------------------------
    //                      S T A T I C
View Full Code Here

        // let velocity parse and generate the result in buffer
        VelocityEngine engine = getVelocityEngine();
        if (log.isDebugEnabled()) {
            log.debug("Velocity is evaluating using velocity context: " + variableMap);
        }
        engine.evaluate(velocityContext, buffer, logTag, reader);

        // now lets output the results to the exchange
        Message out = exchange.getOut();
        out.setBody(buffer.toString());
View Full Code Here

        // let velocity parse and generate the result in buffer
        VelocityEngine engine = getVelocityEngine();
        if (log.isDebugEnabled()) {
            log.debug("Velocity is evaluating using velocity context: " + variableMap);
        }
        engine.evaluate(velocityContext, buffer, logTag, reader);

        // now lets output the results to the exchange
        Message out = exchange.getOut(true);
        out.setBody(buffer.toString());
        out.setHeader("org.apache.camel.velocity.resource", resource);
View Full Code Here

        StringWriter buffer = new StringWriter();
        String logTag = getClass().getName();
        Map variableMap = ExchangeHelper.createVariableMap(exchange);
        Context velocityContext = new VelocityContext(variableMap);
        VelocityEngine engine = getVelocityEngine();
        engine.evaluate(velocityContext, buffer, logTag, reader);

        // now lets output the results to the exchange
        Message out = exchange.getOut(true);
        out.setBody(buffer.toString());
        out.setHeader("org.apache.camel.velocity.resource", getResource());
View Full Code Here

        // let velocity parse and generate the result in buffer
        VelocityEngine engine = getVelocityEngine();
        if (log.isDebugEnabled()) {
            log.debug("Velocity is evaluating using velocity context: " + variableMap);
        }
        engine.evaluate(velocityContext, buffer, logTag, reader);

        // now lets output the results to the exchange
        Message out = exchange.getOut();
        out.setBody(buffer.toString());
View Full Code Here

        Context velocityContext = new VelocityContext(variableMap);

        // let velocity parse and generate the result in buffer
        VelocityEngine engine = getVelocityEngine();
        log.debug("Velocity is evaluating using velocity context: {}", variableMap);
        engine.evaluate(velocityContext, buffer, logTag, reader);

        // now lets output the results to the exchange
        Message out = exchange.getOut();
        out.setBody(buffer.toString());
        out.setHeaders(exchange.getIn().getHeaders());
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.