This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.annotation.processing
interface ProcessingEnvironment


public interface ProcessingEnvironment

An annotation processing tool framework will {@linkplain Processor#init provide an annotation processor with an object implementing this interface} so the processor can use facilities provided by the framework to write new files, report error messages, and find other utilities.

Third parties may wish to provide value-add wrappers around the facility objects from this interface, for example a {@code Filer} extension that allows multiple processors to coordinate writing out a single source file. To enable this, for processors running in a context where their side effects via the API could be visible to each other, the tool infrastructure must provide corresponding facility objects that are {@code .equals}, {@code Filer}s that are {@code .equals}, and so on. In addition, the tool invocation must be able to be configured such that from the perspective of the running annotation processors, at least the chosen subset of helper classes are viewed as being loaded by the same class loader. (Since the facility objects manage shared state, the implementation of a wrapper class must know whether or not the same base facility object has been wrapped before.)


Method Summary
 Elements

          Returns an implementation of some utility methods for operating on elements
 Filer

          Returns the filer used to create new source, class, or auxiliary files.
 Locale

          Returns the current locale or if no locale is in effect.
 Messager

          Returns the messager used to report errors, warnings, and other notices.
 Map

          Returns the processor-specific options passed to the annotation processing tool.
 SourceVersion

          Returns the source version that any generated javax.annotation.processing.Filer.createSourceFile and javax.annotation.processing.Filer.createClassFile files should conform to.
 Types

          Returns an implementation of some utility methods for operating on types.
 

Method Detail

getElementUtils

public Elements getElementUtils()
Returns an implementation of some utility methods for operating on elements

Returns:
element utilities

getFiler

public Filer getFiler()
Returns the filer used to create new source, class, or auxiliary files.

Returns:
the filer

getLocale

public Locale getLocale()
Returns the current locale or {@code null} if no locale is in effect. The locale can be be used to provide localized {@linkplain Messager messages}.

Returns:
the current locale or {@code null} if no locale is in effect

getMessager

public Messager getMessager()
Returns the messager used to report errors, warnings, and other notices.

Returns:
the messager

getOptions

public Map getOptions()
Returns the processor-specific options passed to the annotation processing tool. Options are returned in the form of a map from option name to option value. For an option with no value, the corresponding value in the map is {@code null}.

See documentation of the particular tool infrastructure being used for details on how to pass in processor-specific options. For example, a command-line implementation may distinguish processor-specific options by prefixing them with a known string like {@code "-A"}; other tool implementations may follow different conventions or provide alternative mechanisms. A given implementation may also provide implementation-specific ways of finding options passed to the tool in addition to the processor-specific options.

Returns:
the processor-specific options passed to the tool

getSourceVersion

public SourceVersion getSourceVersion()
Returns the source version that any generated {@linkplain Filer#createSourceFile source} and {@linkplain Filer#createClassFile class} files should conform to.

Returns:
the source version to which generated source and class files should conform to

getTypeUtils

public Types getTypeUtils()
Returns an implementation of some utility methods for operating on types.

Returns:
type utilities


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.