@Internal public class JavaVisitorContext extends java.lang.Object implements VisitorContext, BeanElementVisitorContext
MICRONAUT_BASE_OPTION_NAME, MICRONAUT_PROCESSING_GROUP, MICRONAUT_PROCESSING_MODULE, MICRONAUT_PROCESSING_PROJECT_DIREMPTY| Constructor and Description | 
|---|
JavaVisitorContext(javax.annotation.processing.ProcessingEnvironment processingEnv,
                  javax.annotation.processing.Messager messager,
                  javax.lang.model.util.Elements elements,
                  AnnotationUtils annotationUtils,
                  javax.lang.model.util.Types types,
                  ModelUtils modelUtils,
                  GenericUtils genericUtils,
                  javax.annotation.processing.Filer filer,
                  MutableConvertibleValues<java.lang.Object> visitorAttributes,
                  TypeElementVisitor.VisitorKind visitorKind)
The default constructor. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
BeanElementBuilder | 
addAssociatedBean(Element originatingElement,
                 ClassElement type)  | 
void | 
addGeneratedResource(java.lang.String resource)
Some TypeElementVisitors generate classpath resources that other visitors might be interested in. 
 | 
MutableConvertibleValues<java.lang.Object> | 
clear()
Clear all values. 
 | 
void | 
fail(java.lang.String message,
    Element element)
Allows failing compilation for a given element with the given message. 
 | 
void | 
finish()
Finish writing and flush any service entries to disk. 
 | 
<T> java.util.Optional<T> | 
get(java.lang.CharSequence name,
   ArgumentConversionContext<T> conversionContext)
Resolve the given property for the given name. 
 | 
AnnotationUtils | 
getAnnotationUtils()
The annotation utils. 
 | 
java.util.List<AbstractBeanDefinitionBuilder> | 
getBeanElementBuilders()  | 
java.util.Optional<ClassElement> | 
getClassElement(java.lang.String name)
This method will lookup another class element by name. 
 | 
ClassElement[] | 
getClassElements(java.lang.String aPackage,
                java.lang.String... stereotypes)
Find all the classes within the given package and having the given annotation. 
 | 
java.lang.Iterable<java.net.URL> | 
getClasspathResources(java.lang.String path)
Obtain a set of resources from the user classpath. 
 | 
JavaElementFactory | 
getElementFactory()
Gets the element factory for this visitor context. 
 | 
javax.lang.model.util.Elements | 
getElements()
The elements. 
 | 
java.util.Collection<java.lang.String> | 
getGeneratedResources()
Provide a collection of generated classpath resources that other TypeElement visitors might want to consume. 
 | 
GenericUtils | 
getGenericUtils()
The generic utils object. 
 | 
javax.annotation.processing.Messager | 
getMessager()
The messager. 
 | 
ModelUtils | 
getModelUtils()
The model utils. 
 | 
java.util.Map<java.lang.String,java.lang.String> | 
getOptions()
Java visitor context options from  
javac arguments and System.getProperties() | 
javax.annotation.processing.ProcessingEnvironment | 
getProcessingEnv()  | 
javax.lang.model.util.Types | 
getTypes()
The types. 
 | 
TypeElementVisitor.VisitorKind | 
getVisitorKind()  | 
void | 
info(java.lang.String message)
Allows printing informational messages. 
 | 
void | 
info(java.lang.String message,
    Element element)
Allows printing informational messages. 
 | 
java.util.Set<java.lang.String> | 
names()  | 
MutableConvertibleValues<java.lang.Object> | 
put(java.lang.CharSequence key,
   java.lang.Object value)
Insert a value for the given key and value. 
 | 
MutableConvertibleValues<java.lang.Object> | 
remove(java.lang.CharSequence key)
Remove a value for the given key. 
 | 
java.util.Collection<java.lang.Object> | 
values()  | 
java.io.OutputStream | 
visitClass(java.lang.String classname,
          Element... originatingElements)
Visits a new class and returns the output stream with which should be written the bytes of the class to be
 generated. 
 | 
java.io.OutputStream | 
visitClass(java.lang.String classname,
          Element originatingElement)
Visits a new class and returns the output stream with which should be written the bytes of the class to be
 generated. 
 | 
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,
                Element... originatingElements)
Visit a file within the META-INF directory. 
 | 
void | 
visitServiceDescriptor(java.lang.String type,
                      java.lang.String classname)
Allows adding a class that will be written to the  
META-INF/services file under the given type and class
 name. | 
void | 
warn(java.lang.String message,
    Element element)
Allows printing a warning for the given message and element. 
 | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetClassElement, getClassesOutputPath, getConfiguration, getProjectDir, visitMetaInfFileof, putAll, putAllasMap, asMap, asProperties, contains, empty, forEach, getValue, getValueType, isEmpty, iterator, subMap, subMap, subMapget, get, getgetServiceEntries, visitClass, visitServiceDescriptorpublic JavaVisitorContext(javax.annotation.processing.ProcessingEnvironment processingEnv,
                          javax.annotation.processing.Messager messager,
                          javax.lang.model.util.Elements elements,
                          AnnotationUtils annotationUtils,
                          javax.lang.model.util.Types types,
                          ModelUtils modelUtils,
                          GenericUtils genericUtils,
                          javax.annotation.processing.Filer filer,
                          MutableConvertibleValues<java.lang.Object> visitorAttributes,
                          TypeElementVisitor.VisitorKind visitorKind)
processingEnv - The processing environmentmessager - The messagerelements - The elementsannotationUtils - The annotation utilstypes - Type typesmodelUtils - The model utilsgenericUtils - The generic type utilsfiler - The filervisitorAttributes - The attributesvisitorKind - The visitor kindpublic TypeElementVisitor.VisitorKind getVisitorKind()
public javax.annotation.processing.ProcessingEnvironment getProcessingEnv()
@NonNull public java.lang.Iterable<java.net.URL> getClasspathResources(@NonNull java.lang.String path)
VisitorContextgetClasspathResources in interface VisitorContextpath - The pathpublic java.util.Optional<ClassElement> getClassElement(java.lang.String name)
VisitorContextgetClassElement in interface VisitorContextname - The name@NonNull public ClassElement[] getClassElements(@NonNull java.lang.String aPackage, @NonNull java.lang.String... stereotypes)
VisitorContextgetClassElements in interface VisitorContextaPackage - The packagestereotypes - The stereotypes@NonNull public JavaElementFactory getElementFactory()
VisitorContextgetElementFactory in interface VisitorContextpublic void info(java.lang.String message,
                 @Nullable
                 Element element)
VisitorContextinfo in interface VisitorContextmessage - The messageelement - The elementpublic void info(java.lang.String message)
VisitorContextinfo in interface VisitorContextmessage - The messagepublic void fail(java.lang.String message,
                 @Nullable
                 Element element)
VisitorContextfail in interface VisitorContextmessage - The messageelement - The elementpublic void warn(java.lang.String message,
                 @Nullable
                 Element element)
VisitorContextwarn in interface VisitorContextmessage - The messageelement - The elementpublic java.io.OutputStream visitClass(java.lang.String classname,
                                       @Nullable
                                       Element originatingElement)
                                throws java.io.IOException
ClassWriterOutputVisitorvisitClass in interface ClassWriterOutputVisitorclassname - the fully qualified classnameoriginatingElement - The originating elementjava.io.IOException - if an error occurs creating the output streampublic java.io.OutputStream visitClass(java.lang.String classname,
                                       Element... originatingElements)
                                throws java.io.IOException
ClassWriterOutputVisitor
 Note that this method should only be called from a TypeElementVisitor.VisitorKind.AGGREGATING visitor from within the TypeElementVisitor.finish(io.micronaut.inject.visitor.VisitorContext) method. If the file
visitClass in interface ClassWriterOutputVisitorclassname - the fully qualified classnameoriginatingElements - The originating elementsjava.io.IOException - if an error occurs creating the output streampublic void visitServiceDescriptor(java.lang.String type,
                                   java.lang.String classname)
ClassWriterOutputVisitorMETA-INF/services file under the given type and class
 name.visitServiceDescriptor in interface ClassWriterOutputVisitortype - the fully qualified service nameclassname - the fully qualified classnamepublic java.util.Optional<GeneratedFile> visitMetaInfFile(java.lang.String path, Element... originatingElements)
VisitorContextvisitMetaInfFile in interface VisitorContextvisitMetaInfFile in interface ClassWriterOutputVisitorpath - The path to the fileoriginatingElements - The originating elementspublic java.util.Optional<GeneratedFile> visitGeneratedFile(java.lang.String path)
VisitorContextvisitGeneratedFile in interface VisitorContextvisitGeneratedFile in interface ClassWriterOutputVisitorpath - The path to the filepublic void finish()
ClassWriterOutputVisitorfinish in interface ClassWriterOutputVisitorpublic javax.annotation.processing.Messager getMessager()
public ModelUtils getModelUtils()
public javax.lang.model.util.Elements getElements()
public AnnotationUtils getAnnotationUtils()
public javax.lang.model.util.Types getTypes()
public GenericUtils getGenericUtils()
public java.util.Map<java.lang.String,java.lang.String> getOptions()
javac arguments and System.getProperties()
 System properties has priority over arguments.
getOptions in interface VisitorContextTypeElementVisitor, 
javac argumentspublic MutableConvertibleValues<java.lang.Object> put(java.lang.CharSequence key, @Nullable java.lang.Object value)
MutableConvertibleValuesput in interface MutableConvertibleValues<java.lang.Object>key - The keyvalue - The valuepublic MutableConvertibleValues<java.lang.Object> remove(java.lang.CharSequence key)
MutableConvertibleValuesremove in interface MutableConvertibleValues<java.lang.Object>key - The keypublic MutableConvertibleValues<java.lang.Object> clear()
MutableConvertibleValuesclear in interface MutableConvertibleValues<java.lang.Object>public java.util.Set<java.lang.String> names()
names in interface ConvertibleValues<java.lang.Object>public java.util.Collection<java.lang.Object> values()
values in interface ConvertibleValues<java.lang.Object>public <T> java.util.Optional<T> get(java.lang.CharSequence name,
                                     ArgumentConversionContext<T> conversionContext)
ValueResolverget in interface ValueResolver<java.lang.CharSequence>T - The concrete typename - The nameconversionContext - The conversion contextpublic java.util.Collection<java.lang.String> getGeneratedResources()
VisitorContextgetGeneratedResources in interface VisitorContextpublic void addGeneratedResource(@NonNull java.lang.String resource)
VisitorContextaddGeneratedResource in interface VisitorContextresource - the relative path to add@Internal public java.util.List<AbstractBeanDefinitionBuilder> getBeanElementBuilders()
public BeanElementBuilder addAssociatedBean(Element originatingElement, ClassElement type)
addAssociatedBean in interface BeanElementVisitorContext