net.sf.jelly.apt.freemarker
Class FreemarkerProcessor

java.lang.Object
  extended by net.sf.jelly.apt.freemarker.FreemarkerProcessor
All Implemented Interfaces:
com.sun.mirror.apt.AnnotationProcessor

public class FreemarkerProcessor
extends java.lang.Object
implements com.sun.mirror.apt.AnnotationProcessor

The processor for a freemarker template file.

Author:
Ryan Heaton

Constructor Summary
FreemarkerProcessor(java.net.URL templateURL)
           
 
Method Summary
protected  freemarker.template.Configuration getConfiguration()
          Get the freemarker configuration.
protected  APTJellyObjectWrapper getObjectWrapper()
          Get the object wrapper for the main model.
protected  FreemarkerModel getRootModel()
          The root data model for the template.
protected  freemarker.cache.URLTemplateLoader getTemplateLoader()
          Get the template loader for the freemarker configuration.
 java.net.URL getTemplateURL()
          The template URL.
protected  java.util.Collection<FreemarkerTransform> getTransforms()
          The collection of transforms to establish in the model before processing.
protected  java.util.Collection<FreemarkerVariable> getVariables()
          The collection of variables to establish in the model before processing.
protected  FreemarkerModel newRootModel()
          Instantiate a new root model.
 void process()
           
protected  void process(java.io.IOException e)
          Process an IOException.
protected  void process(freemarker.template.TemplateException e)
          Process a TemplateException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FreemarkerProcessor

public FreemarkerProcessor(java.net.URL templateURL)
Method Detail

process

public void process()
Specified by:
process in interface com.sun.mirror.apt.AnnotationProcessor

getTemplateURL

public java.net.URL getTemplateURL()
The template URL.

Returns:
The template URL.

process

protected void process(freemarker.template.TemplateException e)
Process a TemplateException. Default wraps it in a RuntimeException.

Parameters:
e - The exception to process.

process

protected void process(java.io.IOException e)
Process an IOException. Default wraps it in a RuntimeException.

Parameters:
e - The exception to process.

getObjectWrapper

protected APTJellyObjectWrapper getObjectWrapper()
Get the object wrapper for the main model.

Returns:
the object wrapper for the main model.

getRootModel

protected FreemarkerModel getRootModel()
                                throws freemarker.template.TemplateModelException
The root data model for the template.

Returns:
The root data model for the template.
Throws:
freemarker.template.TemplateModelException

newRootModel

protected FreemarkerModel newRootModel()
Instantiate a new root model.

Returns:
The new root model.

getConfiguration

protected freemarker.template.Configuration getConfiguration()
Get the freemarker configuration.

Returns:
the freemarker configuration.

getTransforms

protected java.util.Collection<FreemarkerTransform> getTransforms()
The collection of transforms to establish in the model before processing.

Returns:
The collection of transforms to establish in the model before processing.

getVariables

protected java.util.Collection<FreemarkerVariable> getVariables()
The collection of variables to establish in the model before processing.

Returns:
The collection of variables to establish in the model before processing.

getTemplateLoader

protected freemarker.cache.URLTemplateLoader getTemplateLoader()
Get the template loader for the freemarker configuration.

Returns:
the template loader for the freemarker configuration.