The ProcessingEnvironment instance can be downcasted to SakerProcessingEnvironment during annotation processing.
The interface provides access to the name of the current source version enumeration that can avoid unexpected exceptions when the annotation processing and compilation are being done in a separate JVM.
public SakerElementsTypes | Returns an implementation of some utility methods for
operating on elements |
public SakerFiler | getFiler() Returns the filer used to create new source, class, or auxiliary
files. |
public SakerMessager | Returns the messager used to report errors, warnings, and other
notices. |
public SourceVersion | |
public String | Gets the name of the SourceVersion value returned by getSourceVersion(). |
public SakerElementsTypes | Returns an implementation of some utility methods for
operating on types. |
From: ProcessingEnvironment |
It is recommended that callers attempt to catch an IllegalArgumentException instead, to avoid any class loading related versioning issues.
This method serves the compatibility support when processing sources of a higher language model that can be represented in the current JVM.
E.g. if the compilation source version is RELEASE_9
, and the current JVM has the version 8, then the
SourceVersion.RELEASE_9
doesn't exist in the current JVM, therefore
SourceVersion.valueOf(