-
public interface ProcessingEnvironment
An annotation processing tool framework will 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
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.equals
,Filer
s that are.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.)- Since:
- 1.6
-
-
Method Summary
Methods Modifier and Type Method and Description Elements
getElementUtils()
Returns an implementation of some utility methods for operating on elementsFiler
getFiler()
Returns the filer used to create new source, class, or auxiliary files.Locale
getLocale()
Returns the current locale ornull
if no locale is in effect.Messager
getMessager()
Returns the messager used to report errors, warnings, and other notices.Map<String,String>
getOptions()
Returns the processor-specific options passed to the annotation processing tool.SourceVersion
getSourceVersion()
Types
getTypeUtils()
Returns an implementation of some utility methods for operating on types.
-
-
-
Method Detail
-
getOptions
Map<String,String> 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 isnull
.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
"-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
-
getMessager
Messager getMessager()
Returns the messager used to report errors, warnings, and other notices.- Returns:
- the messager
-
getFiler
Filer getFiler()
Returns the filer used to create new source, class, or auxiliary files.- Returns:
- the filer
-
getElementUtils
Elements getElementUtils()
Returns an implementation of some utility methods for operating on elements- Returns:
- element utilities
-
getTypeUtils
Types getTypeUtils()
Returns an implementation of some utility methods for operating on types.- Returns:
- type utilities
-
getSourceVersion
SourceVersion getSourceVersion()
- Returns:
- the source version to which generated source and class files should conform to
- See Also:
Processor.getSupportedSourceVersion()
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
24/11/2024 14:12:08 Cette version de la page est en cache (à la date du 24/11/2024 14:12:08) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 11/06/2005, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/annotation/processing/ProcessingEnvironment.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.