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