Code example for CharArrayWriter

Methods: toString

0
        this.ctx = ctx;
        this.velocityEngine = engine;
    } 
 
    public String evaluate(String expression) throws IOException, ResourceNotFoundException, MethodInvocationException, ParseErrorException {
        CharArrayWriter writer = new CharArrayWriter();
        velocityEngine.evaluate(ctx, writer, "Error parsing " + expression, expression);
 
        return writer.toString();
    } 
 
}