public interface VisitorContext extends MutableConvertibleValues<java.lang.Object>, ClassWriterOutputVisitor
TypeElementVisitor
classes to log messages during compilation and fail compilation.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MICRONAUT_BASE_OPTION_NAME |
static java.lang.String |
MICRONAUT_PROCESSING_GROUP |
static java.lang.String |
MICRONAUT_PROCESSING_MODULE |
static java.lang.String |
MICRONAUT_PROCESSING_PROJECT_DIR |
EMPTY
Modifier and Type | Method and Description |
---|---|
void |
fail(java.lang.String message,
Element element)
Allows failing compilation for a given element with the given message.
|
default java.util.Optional<ClassElement> |
getClassElement(java.lang.Class<?> type)
This method will lookup another class element by name.
|
default java.util.Optional<ClassElement> |
getClassElement(java.lang.String name)
This method will lookup another class element by name.
|
default ClassElement[] |
getClassElements(java.lang.String aPackage,
java.lang.String... stereotypes)
Find all the classes within the given package and having the given annotation.
|
default java.lang.Iterable<java.net.URL> |
getClasspathResources(java.lang.String path)
Obtain a set of resources from the user classpath.
|
default java.util.Map<java.lang.String,java.lang.String> |
getOptions()
The annotation processor environment custom options.
|
default java.util.Optional<java.nio.file.Path> |
getProjectDir()
Obtain the project directory.
|
void |
info(java.lang.String message)
Allows printing informational messages.
|
void |
info(java.lang.String message,
Element element)
Allows printing informational messages.
|
java.util.Optional<GeneratedFile> |
visitGeneratedFile(java.lang.String path)
Visit a file that will be located within the generated source directory.
|
java.util.Optional<GeneratedFile> |
visitMetaInfFile(java.lang.String path)
Visit a file within the META-INF directory.
|
void |
warn(java.lang.String message,
Element element)
Allows printing a warning for the given message and element.
|
clear, of, put, putAll, putAll, remove
asMap, asMap, asProperties, contains, empty, forEach, getValue, getValueType, isEmpty, iterator, names, subMap, subMap, subMap, values
get, get, get, get
finish, getServiceEntries, visitClass, visitClass, visitServiceDescriptor, visitServiceDescriptor
static final java.lang.String MICRONAUT_BASE_OPTION_NAME
static final java.lang.String MICRONAUT_PROCESSING_PROJECT_DIR
static final java.lang.String MICRONAUT_PROCESSING_GROUP
static final java.lang.String MICRONAUT_PROCESSING_MODULE
void info(java.lang.String message, @Nullable Element element)
message
- The messageelement
- The elementvoid info(java.lang.String message)
message
- The messagevoid fail(java.lang.String message, @Nullable Element element)
message
- The messageelement
- The elementvoid warn(java.lang.String message, @Nullable Element element)
message
- The messageelement
- The elementjava.util.Optional<GeneratedFile> visitMetaInfFile(java.lang.String path)
visitMetaInfFile
in interface ClassWriterOutputVisitor
path
- The path to the filejava.util.Optional<GeneratedFile> visitGeneratedFile(java.lang.String path)
visitGeneratedFile
in interface ClassWriterOutputVisitor
path
- The path to the file@NonNull default java.lang.Iterable<java.net.URL> getClasspathResources(@NonNull java.lang.String path)
path
- The pathdefault java.util.Optional<java.nio.file.Path> getProjectDir()
default java.util.Optional<ClassElement> getClassElement(java.lang.String name)
name
- The namedefault java.util.Optional<ClassElement> getClassElement(java.lang.Class<?> type)
type
- The name@NonNull default ClassElement[] getClassElements(@NonNull java.lang.String aPackage, @NonNull java.lang.String... stereotypes)
aPackage
- The packagestereotypes
- The stereotypesdefault java.util.Map<java.lang.String,java.lang.String> getOptions()
All options names MUST start with MICRONAUT_BASE_OPTION_NAME
ProcessingEnvironment.getOptions()