ccc.plugins.scripting
Interface TextProcessor

All Known Implementing Classes:
AbstractTextProcessor, ScriptRunner, VelocityProcessor

public interface TextProcessor

API for text processing.

Author:
Civic Computing Ltd.

Method Summary
 java.lang.String render(Script template, Context context)
          Render a resource with the specified template.
 void render(Script template, java.io.Writer output, Context context)
          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.
 

Method Detail

render

java.lang.String render(Script template,
                        Context context)
                        throws ProcessingException
Render a resource with the specified template.

The rendered output will be stored in memory as a String. Therefore, caution should be taken that this method is not used to generate large output, otherwise an OutOfMemoryError could be thrown.

Parameters:
template - The template used to render the resource.
context - Additional values that are passed to the template.
Returns:
The html rendering as a string.
Throws:
ProcessingException - If an error occurs during rendering.

render

void render(Script template,
            java.io.Writer output,
            Context context)
            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.
context - Additional values that are passed to the template.
Throws:
ProcessingException - If an error occurs during rendering.

setWhitelist

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.