apt-jelly

  soothes irritation and swelling caused by abrasive annotation processing


   

Introduction

The following is a reference to the APT-Jelly directives. You may want to read the section on the directives in the reference guide to establish a context for using this directive reference. You may also way to refer to the API Documentation.

  • annotationValue: Outputs an annotation value.
  • file: Redirects output to a new file.
  • forAllConstructors: Evaluates its block for all constructors of the specified type declaration.
  • forAllFields: Evaluates its block for all fields of the specified type declaration.
  • forAllImportedTypes: Evaluates its block for all imported types of a specified type declaration.
  • forAllMethods: Evaluates its block for all methods of the specified type declaration.
  • forAllNestedTypes: Evaluates its block for all nested types of the specified type declaration.
  • forAllPackages: Evaluates its block for all packages in the source base.
  • forAllParameters: Evaluates its block for all parameters of the specified executable declaration.
  • forAllThrownTypes: Evaluates its block for all thrown types of the specified executable declaration.
  • forAllTypes: Evaluates its block for all type declarations in the source base.
  • ifHasAnnotation: Evaluates its block if the specified declaration has a specified annotation.
  • ifHasDeclaration: Evaluates its block if the specified type mirror has a declaration.
  • javaSource: Redirects its output to a java source file.
  • primitiveWrapper: Outputs the name of the wrapper class associated with a primitive.
  • wrapIfPrimitive: Wraps its body in a wrapper class constructor if a type is primitive.
  • unwrapIfPrimitive: Unwraps its body from a wrapper class if a type is primitive.


annotationValue

Outputs an annotation value. If a declaration is specified, it will be used to lookup the annotation value. Otherwise, this directive must be nested within a declaration loop directive and the current declaration will be used. If a default value is specified, it will be output if either (1) the specified annotation doesn't exist, (2) the specified annotation element doesn't exist, or (3) the value of the specified annotation element is its default value. If no default value is specified, the declared default value of the element will be output (if there is one). Otherwise, nothing will be output.

parameter description required? default
declaration The declaration on which to get the annotation value. Yes, unless nested within a declaration loop directive. N/A
annotation The fully-qualified classname of annotation. Yes (none)
element The annotation element (i.e. method) to output. No "value"
default The default value to output if either (1) the specified annotation doesn't exist, (2) the specified annotation element doesn't exist, or (3) the value of the specified annotation element is its default value. No (none)


file

Redirects its output to a new file, relative to the output directory specified to APT.

parameter description required? default
name The simple name of the file (not the full path). Yes N/A
package The package into which this file should be put. No (none)
charset The character set to use for the output. No (none)


forAllConstructors

Evaluates its block for all constructors of the specified type declaration. If a type declaration is specified, its constructors will be used. Otherwise, this directive must be nested within a declaration loop directive for type declarations and the constructors of the current declaration will be used. It is not illegal to specify an interface type declaration, but there will be no constructors.

parameter description required? default
var The context variable to which to assign the current declaration No (none)
indexVar The context variable to which to assign the current loop index. No (none)
declaration The type declaration containing the declarations over which to iterate. Yes, unless nested within a declaration loop directive for types. N/A
annotation If specified, limit the set of declarations over which to loop to be those that are annotated with this annotation. Annotation name must be fully-qualified. No (none)
excludes If specified, read the value of this parameter as a comma-separated list of annotations that indicate that this declaration should be excluded from the loop. No (none)
annotationVar The context variable to which to assign the specified annotation mirror on the current declaration (specified by the "annotation" parameter). No (none)
includeSuperclasses Whether to include the declarations of superclasses in the set of declarations over which to iterate. No false
includeSuperinterfaces Whether to include the declarations of superinterfaces in the set of declarations over which to iterate. No false


forAllFields

Evaluates its block for all fields of the specified type declaration. If a type declaration is specified, its fields will be used. Otherwise, this directive must be nested within a declaration loop directive for type declarations and the fields of the current declaration will be used.

parameter description required? default
var The context variable to which to assign the current declaration No (none)
indexVar The context variable to which to assign the current loop index. No (none)
declaration The type declaration containing the declarations over which to iterate. Yes, unless nested within a declaration loop directive for types. N/A
annotation If specified, limit the set of declarations over which to loop to be those that are annotated with this annotation. Annotation name must be fully-qualified. No (none)
excludes If specified, read the value of this parameter as a comma-separated list of annotations that indicate that this declaration should be excluded from the loop. No (none)
annotationVar The context variable to which to assign the specified annotation mirror on the current declaration (specified by the "annotation" parameter). No (none)
includeSuperclasses Whether to include the declarations of superclasses in the set of declarations over which to iterate. No false
includeSuperinterfaces Whether to include the declarations of superinterfaces in the set of declarations over which to iterate. No false


forAllImportedTypes

Evaluates its block for all imported types of a specified type declaration. If a type declaration is specified, its imported types will be used. Otherwise, this directive must be nested within a declaration loop directive for type declarations and the imported types of the current declaration will be used. The list of imported types is calculated--it does NOT correspond to the list of import statements in the source code, but it is generated by iterating over the member declarations of the specified type declaration. This list will include the bounds of any formal type parameters. This list will NOT include annotations.

parameter description required? default
var The context variable to which to assign the current declaration No (none)
indexVar The context variable to which to assign the current loop index. No (none)
declaration The type declaration containing the declarations over which to iterate. Yes, unless nested within a declaration loop directive for types. N/A
annotation If specified, limit the set of declarations over which to loop to be those that are annotated with this annotation. Annotation name must be fully-qualified. No (none)
excludes If specified, read the value of this parameter as a comma-separated list of annotations that indicate that this declaration should be excluded from the loop. No (none)
annotationVar The context variable to which to assign the specified annotation mirror on the current declaration (specified by the "annotation" parameter). No (none)
includeClasses Whether to include classes in the list of declarations over which to iterate. No true
includeInterfaces Whether to include interfaces in the list of declarations over which to iterate. No true


forAllMethods

Evaluates its block for all methods of the specified type declaration. If a type declaration is specified, its methods will be used. Otherwise, this directive must be nested within a declaration loop directive for type declarations and the methods of the current declaration will be used.

parameter description required? default
var The context variable to which to assign the current declaration No (none)
indexVar The context variable to which to assign the current loop index. No (none)
declaration The type declaration containing the declarations over which to iterate. Yes, unless nested within a declaration loop directive for types. N/A
annotation If specified, limit the set of declarations over which to loop to be those that are annotated with this annotation. Annotation name must be fully-qualified. No (none)
excludes If specified, read the value of this parameter as a comma-separated list of annotations that indicate that this declaration should be excluded from the loop. No (none)
annotationVar The context variable to which to assign the specified annotation mirror on the current declaration (specified by the "annotation" parameter). No (none)
includeSuperclasses Whether to include the declarations of superclasses in the set of declarations over which to iterate. No false
includeSuperinterfaces Whether to include the declarations of superinterfaces in the set of declarations over which to iterate. No false
returnTypeVar The context variable to which to assign the type mirror of the return type for this method. No (none)


forAllNestedTypes

Evaluates its block for all nested types of the specified type declaration. If a type declaration is specified, its nested types will be used. Otherwise, this directive must be nested within a declaration loop directive for type declarations and the nested types of the current declaration will be used.

parameter description required? default
var The context variable to which to assign the current declaration No (none)
indexVar The context variable to which to assign the current loop index. No (none)
declaration The type declaration containing the declarations over which to iterate. Yes, unless nested within a declaration loop directive for types. N/A
annotation If specified, limit the set of declarations over which to loop to be those that are annotated with this annotation. Annotation name must be fully-qualified. No (none)
excludes If specified, read the value of this parameter as a comma-separated list of annotations that indicate that this declaration should be excluded from the loop. No (none)
annotationVar The context variable to which to assign the specified annotation mirror on the current declaration (specified by the "annotation" parameter). No (none)
includeClasses Whether to include classes in the list of declarations over which to iterate. No true
includeInterfaces Whether to include interfaces in the list of declarations over which to iterate. No true


forAllPackages

Evaluates its block for all packages in the source base.

parameter description required? default
var The context variable to which to assign the current declaration No (none)
indexVar The context variable to which to assign the current loop index. No (none)
annotation If specified, limit the set of declarations over which to loop to be those that are annotated with this annotation. Annotation name must be fully-qualified. No (none)
excludes If specified, read the value of this parameter as a comma-separated list of annotations that indicate that this declaration should be excluded from the loop. No (none)
annotationVar The context variable to which to assign the specified annotation mirror on the current declaration (specified by the "annotation" parameter). No (none)


forAllParameters

Evaluates its block for all parameters of the specified executable declaration. If a executable declaration is specified, its parameters will be used. Otherwise, this directive must be nested within a declaration loop directive for executable declarations and the parameters of the current declaration will be used.

parameter description required? default
var The context variable to which to assign the current declaration No (none)
indexVar The context variable to which to assign the current loop index. No (none)
declaration The executable declaration containing the declarations over which to iterate. Yes, unless nested within a declaration loop directive for executables. N/A
annotation If specified, limit the set of declarations over which to loop to be those that are annotated with this annotation. Annotation name must be fully-qualified. No (none)
excludes If specified, read the value of this parameter as a comma-separated list of annotations that indicate that this declaration should be excluded from the loop. No (none)
annotationVar The context variable to which to assign the specified annotation mirror on the current declaration (specified by the "annotation" parameter). No (none)


forAllThrownTypes

Evaluates its block for all thrown types of the specified executable declaration. If a executable declaration is specified, its thrown types will be used. Otherwise, this directive must be nested within a declaration loop directive for executable declarations and the thrown types of the current declaration will be used.

parameter description required? default
var The context variable to which to assign the current thrown type mirror No (none)
indexVar The context variable to which to assign the current loop index. No (none)
declaration The executable declaration containing the thrown types over which to iterate. Yes, unless nested within a declaration loop directive for executables. N/A


forAllTypes

Evaluates its block for all type declarations in the source base.

parameter description required? default
var The context variable to which to assign the current declaration No (none)
indexVar The context variable to which to assign the current loop index. No (none)
annotation If specified, limit the set of declarations over which to loop to be those that are annotated with this annotation. Annotation name must be fully-qualified. No (none)
excludes If specified, read the value of this parameter as a comma-separated list of annotations that indicate that this declaration should be excluded from the loop. No (none)
annotationVar The context variable to which to assign the specified annotation mirror on the current declaration (specified by the "annotation" parameter). No (none)
includeClasses Whether to include classes in the list of declarations over which to iterate. No true
includeInterfaces Whether to include interfaces in the list of declarations over which to iterate. No false


ifHasAnnotation

Evaluates its block if the specified declaration has a specified annotation. If a declaration is specified, it will be used to lookup the annotation value. Otherwise, this directive must be nested within a declaration loop directive and the current declaration will be used.

parameter description required? default
var The context variable to which to assign the annotation mirror, if it exists. No (none)
declaration The declaration on which to evaluate whether exists the annotation. Yes, unless nested within a declaration loop directive. N/A
annotation The fully-qualified name of the annotation for which to test for existence. Yes N/A


ifHasDeclaration

Evaluates its block if the specified type mirror has a declaration.

parameter description required? default
type The type mirror on which to evaluate whether it has a declaration. Yes N/A
declarationVar The context variable to which to assign the declaration, if it exists. No (none)


javaSource

Redirects its output to a java source file.

parameter description required? default
name The fully-qualified class name of java class for which this directive's body is to be the java source. Yes N/A


primitiveWrapper

Outputs the name of the wrapper class associated with the specified primitive type.

parameter description required? default
type The primitive type for which to output the name of its associated wrapper class. Yes N/A


wrapIfPrimitive

Wraps its body in the constructor for the wrapper class associated with the specified primitive type. If the specified type is not primitive, no wrapping is performed.

parameter description required? default
type The primitive type to wrap. Yes N/A


unwrapIfPrimitive

Unwraps its body into the specified primitive type. If the specified type is not primitive, no unwrapping is performed.

parameter description required? default
type The primitive type to unwrap. Yes N/A

page design by Phlash