net.sf.jelly.apt
Class ProcessorFactory

java.lang.Object
  extended by net.sf.jelly.apt.ProcessorFactory
All Implemented Interfaces:
com.sun.mirror.apt.AnnotationProcessorFactory
Direct Known Subclasses:
APTJellyProcessorFactory, FreemarkerProcessorFactory

public abstract class ProcessorFactory
extends java.lang.Object
implements com.sun.mirror.apt.AnnotationProcessorFactory

Base class for the annotation processor factory.

Author:
Ryan Heaton

Field Summary
static java.lang.String DECLARATION_DECORATOR_OPTION
          Option for specifying the declaration decorator.
protected static int round
           
protected  java.net.URL template
           
static java.lang.String TEMPLATE_FILE_OPTION
          Option to pass to APT specifying the template file on the filesystem to invoke.
static java.lang.String TEMPLATE_URL_OPTION
          Option to pass to APT specifying a URL of the template to invoke.
static java.lang.String TYPE_DECORATOR_OPTION
          Option for specifying the type decorator.
 
Constructor Summary
protected ProcessorFactory()
           
protected ProcessorFactory(java.net.URL template)
           
 
Method Summary
protected  com.sun.mirror.apt.AnnotationProcessorEnvironment decorateEnvironment(com.sun.mirror.apt.AnnotationProcessorEnvironment env)
          Decorate the annotation processor environment.
protected  com.sun.mirror.apt.AnnotationProcessor getProcessorFor(java.util.Set<com.sun.mirror.declaration.AnnotationTypeDeclaration> annotations)
          Get a freemarker processor.
 com.sun.mirror.apt.AnnotationProcessor getProcessorFor(java.util.Set<com.sun.mirror.declaration.AnnotationTypeDeclaration> set, com.sun.mirror.apt.AnnotationProcessorEnvironment env)
          Default implementation ensures only one APT round does any work and establishes the context before instantiating the processor.
protected  java.net.URL getTemplateURL()
          Get the URL to the template.
protected abstract  com.sun.mirror.apt.AnnotationProcessor newProcessor(java.net.URL url)
          Instantiate a new processor.
 java.util.Collection<java.lang.String> supportedAnnotationTypes()
          By default, all annotation types are supported.
 java.util.Collection<java.lang.String> supportedOptions()
          The supported options for this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEMPLATE_FILE_OPTION

public static final java.lang.String TEMPLATE_FILE_OPTION
Option to pass to APT specifying the template file on the filesystem to invoke.

See Also:
Constant Field Values

TEMPLATE_URL_OPTION

public static final java.lang.String TEMPLATE_URL_OPTION
Option to pass to APT specifying a URL of the template to invoke.

See Also:
Constant Field Values

DECLARATION_DECORATOR_OPTION

public static final java.lang.String DECLARATION_DECORATOR_OPTION
Option for specifying the declaration decorator.


TYPE_DECORATOR_OPTION

public static final java.lang.String TYPE_DECORATOR_OPTION
Option for specifying the type decorator.


round

protected static int round

template

protected java.net.URL template
Constructor Detail

ProcessorFactory

protected ProcessorFactory()

ProcessorFactory

protected ProcessorFactory(java.net.URL template)
Method Detail

supportedOptions

public java.util.Collection<java.lang.String> supportedOptions()
The supported options for this factory.

Specified by:
supportedOptions in interface com.sun.mirror.apt.AnnotationProcessorFactory
Returns:
The supported options for this factory.

supportedAnnotationTypes

public java.util.Collection<java.lang.String> supportedAnnotationTypes()
By default, all annotation types are supported.

Specified by:
supportedAnnotationTypes in interface com.sun.mirror.apt.AnnotationProcessorFactory
Returns:
The wildcard ("*").

getProcessorFor

public com.sun.mirror.apt.AnnotationProcessor getProcessorFor(java.util.Set<com.sun.mirror.declaration.AnnotationTypeDeclaration> set,
                                                              com.sun.mirror.apt.AnnotationProcessorEnvironment env)
Default implementation ensures only one APT round does any work and establishes the context before instantiating the processor.

Specified by:
getProcessorFor in interface com.sun.mirror.apt.AnnotationProcessorFactory
Parameters:
set - The relevant annotation types.
env - The environment.
Returns:
The processor.

getProcessorFor

protected com.sun.mirror.apt.AnnotationProcessor getProcessorFor(java.util.Set<com.sun.mirror.declaration.AnnotationTypeDeclaration> annotations)
Get a freemarker processor.

Parameters:
annotations - The annotations.
Returns:
The freemarker processor.

decorateEnvironment

protected com.sun.mirror.apt.AnnotationProcessorEnvironment decorateEnvironment(com.sun.mirror.apt.AnnotationProcessorEnvironment env)
Decorate the annotation processor environment.

Parameters:
env - The environment to decorate.
Returns:
The decorated environment.

getTemplateURL

protected java.net.URL getTemplateURL()
Get the URL to the template.

Returns:
The URL to the template.

newProcessor

protected abstract com.sun.mirror.apt.AnnotationProcessor newProcessor(java.net.URL url)
Instantiate a new processor.

Parameters:
url - The URL to the template.
Returns:
The processor.