Also included is support for writing {@linkplain com.sun.mirror.apt.AnnotationProcessor annotation processors} to examine and process the annotations of program elements. An annotation processor may, as an example, create new source files and XML documents to be used in conjunction with the original code.
Programs are modeled in their static, or build-time, form. This differs from the {@linkplain java.lang.reflect reflection} API, which provides run-time information about classes and objects.
The API does not provide direct support for generating new code.
Types are represented by the {@link com.sun.mirror.type.TypeMirror} interface and its hierarchy of subinterfaces in the package {@link com.sun.mirror.type}. Types include primitive types, class and interface types, array types, type variables, and wildcards. The interface hierarchy is depicted here.
The API makes a clear distinction between declarations and types.
This is most significant for generic types, where a single declaration
can define an infinite family of types. For example, the declaration of
java.util.Set defines the raw type java.util.Set,
the parameterized type {@code java.util.Set A program being modeled may be incomplete, in that
it may depend on an unknown class or interface type.
This may be the result of a processing error such as a missing class file,
or perhaps the missing type is to be created by an annotation processor.
See {@link com.sun.mirror.type.DeclaredType} for information on
how such unknown types are handled.
The {@link com.sun.mirror.apt} package supports the writing
of annotation processors. It provides the mechanism for them to
interact with an annotation processing tool.
@since 1.5
Utilities and Tool Support
The {@link com.sun.mirror.util} package provides
utilities to assist in the processing of declarations and types.
Included is support for using the visitor design pattern when
operating on declaration and type objects.