public final class ProcessingEnvironments extends Object
The current environment must be setup for the
current thread. After that, processing code running on that same thread can conveniently
access the environment and the Elements
and Types
utility interfaces using static
methods on this class.
Modifier and Type | Method and Description |
---|---|
static Elements |
elements()
Gets the current implementation of utility methods relating to elements.
|
static ProcessingEnvironment |
get()
Gets the environment for the current thread.
|
static void |
reset()
Resets the current thread, clearing thread-local state related to the current environment.
|
static void |
setup(ProcessingEnvironment env)
Sets up the environment for the current thread.
|
static Types |
types()
Gets the current implementation of utility methods relating to types.
|
public static void reset()
setup(javax.annotation.processing.ProcessingEnvironment)
on this thread.IllegalStateException
- if the environment has not been setup on this threadpublic static void setup(ProcessingEnvironment env)
env
- the current processing environmentIllegalStateException
- if the environment has already been setup on this threadpublic static ProcessingEnvironment get()
IllegalStateException
- if the environment has not been setup on this threadpublic static Elements elements()
ProcessingEnvironments.get().getElementUtils()
.IllegalStateException
- if the environment has not been setup on this threadpublic static Types types()
ProcessingEnvironments.get().getTypeUtils()
.IllegalStateException
- if the environment has not been setup on this thread