ccc.plugins.scripting.velocity
Class VelocityProcessor

java.lang.Object
  extended by ccc.plugins.scripting.AbstractTextProcessor
      extended by ccc.plugins.scripting.velocity.VelocityProcessor
All Implemented Interfaces:
TextProcessor

public class VelocityProcessor
extends AbstractTextProcessor

Renders a resource as text using the velocity library.

Author:
Civic Computing Ltd.

Nested Class Summary
static class VelocityProcessor.EntityNotFoundHandler
          Velocity event handler to convert EntityNotFoundExceptions to NULL.
 
Constructor Summary
VelocityProcessor()
           
 
Method Summary
 void render(Script template, java.io.Writer output, Context ctxt)
          Render a resource with the specified template.
 void setWhitelist(java.util.List<java.lang.String> allowedClasses)
          Specify a list of classes accessible to this processor.
 
Methods inherited from class ccc.plugins.scripting.AbstractTextProcessor
handleException, render
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VelocityProcessor

public VelocityProcessor()
Method Detail

render

public void render(Script template,
                   java.io.Writer output,
                   Context ctxt)
            throws ProcessingException
Render a resource with the specified template.

The rendered output will be written to the specified writer.

Parameters:
template - The template used to render the resource.
output - A valid Writer. The writer will be flushed when output is complete. The writer will not be closed.
ctxt - Additional values that are passed to the template.
Throws:
ProcessingException - If an error occurs during rendering.

setWhitelist

public void setWhitelist(java.util.List<java.lang.String> allowedClasses)
Specify a list of classes accessible to this processor.

Parameters:
allowedClasses - The list of classes.


Copyright © 2010. All Rights Reserved.