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 | 
|---|---|
default void | 
addGeneratedResource(java.lang.String resource)
Some TypeElementVisitors generate classpath resources that other visitors might be interested in. 
 | 
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.util.Optional<java.nio.file.Path> | 
getClassesOutputPath()
Provide the Path to the annotation processing classes output directory, i.e. 
 | 
default java.lang.Iterable<java.net.URL> | 
getClasspathResources(java.lang.String path)
Obtain a set of resources from the user classpath. 
 | 
default VisitorConfiguration | 
getConfiguration()  | 
ElementFactory<?,?,?,?> | 
getElementFactory()
Gets the element factory for this visitor context. 
 | 
default java.util.Collection<java.lang.String> | 
getGeneratedResources()
Provide a collection of generated classpath resources that other TypeElement visitors might want to consume. 
 | 
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. 
 | 
default java.util.Optional<GeneratedFile> | 
visitMetaInfFile(java.lang.String path)
Deprecated. 
 
Visiting a file should supply the originating elements. Use  
visitMetaInfFile(String, Element...) instead | 
java.util.Optional<GeneratedFile> | 
visitMetaInfFile(java.lang.String path,
                Element... originatingElements)
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, removeasMap, asMap, asProperties, contains, empty, forEach, getValue, getValueType, isEmpty, iterator, names, subMap, subMap, subMap, valuesget, get, get, getfinish, getServiceEntries, visitClass, visitClass, visitClass, visitServiceDescriptor, visitServiceDescriptorstatic 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
@NonNull ElementFactory<?,?,?,?> getElementFactory()
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 element@NonNull default VisitorConfiguration getConfiguration()
@Deprecated default java.util.Optional<GeneratedFile> visitMetaInfFile(java.lang.String path)
visitMetaInfFile(String, Element...) insteadvisitMetaInfFile in interface ClassWriterOutputVisitorpath - The path to the filejava.util.Optional<GeneratedFile> visitMetaInfFile(java.lang.String path, Element... originatingElements)
visitMetaInfFile in interface ClassWriterOutputVisitorpath - The path to the fileoriginatingElements - The originating elementsjava.util.Optional<GeneratedFile> visitGeneratedFile(java.lang.String path)
visitGeneratedFile in interface ClassWriterOutputVisitorpath - 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<java.nio.file.Path> getClassesOutputPath()
This might, for example, be used as a convenience for TypeElementVisitor classes to provide
 relative path strings to addGeneratedResource(String)
 Path resource = ... // absolute path to the resource
 visitorContext.getClassesOutputPath().ifPresent(path ->
     visitorContext.addGeneratedResource(path.relativize(resource).toString()));
 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()default java.util.Collection<java.lang.String> getGeneratedResources()
default void addGeneratedResource(java.lang.String resource)
resource - the relative path to add