Class PythonAnnotationProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
io.micronaut.annotation.processing.AbstractInjectAnnotationProcessor
io.micronaut.python.processing.PythonAnnotationProcessor
- All Implemented Interfaces:
AutoCloseable, Processor
@SupportedAnnotationTypes("io.micronaut.context.python.annotation.PythonApplication")
public class PythonAnnotationProcessor
extends AbstractInjectAnnotationProcessor
implements AutoCloseable
Annotation processor for
io.micronaut.context.python.annotation.PythonApplication that enables Python AST processing
during Java compilation.- Since:
- 5.2.0
- Author:
- Micronaut
-
Field Summary
FieldsFields inherited from class AbstractInjectAnnotationProcessor
classWriterOutputVisitor, elementUtils, filer, GRADLE_PROCESSING_AGGREGATING, GRADLE_PROCESSING_ISOLATING, javaVisitorContext, messager, MICRONAUT_PROCESSING_ANNOTATIONS, MICRONAUT_PROCESSING_INCREMENTAL, modelUtils, postponedTypes, typeUtils, visitorAttributesFields inherited from class AbstractProcessor
processingEnv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidinit(ProcessingEnvironment processingEnv) booleanprocess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) voidsetClassElementCallback(Consumer<ClassElement> callback) Set the callback to be invoked for each class element created during processing.voidsetClassLoader(ClassLoader classLoader) Sets the class loader used for in-memory compiler execution.voidsetCompilePythonBytecode(boolean compilePythonBytecode) Set whether generated Python VFS resources should include GraalPy bytecode caches.voidsetPythonSourceVisitors(List<PythonSourceVisitor> pythonSourceVisitors) Sets visitors for Python source metadata in this compilation.Methods inherited from class AbstractInjectAnnotationProcessor
error, error, getIncrementalProcessorType, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, getVisitorKind, isIncremental, isProcessedAnnotation, newVisitorContext, note, note, processingGeneratedAnnotation, warning, warningMethods inherited from class AbstractProcessor
getCompletions, isInitialized
-
Field Details
-
APPLICATION_PATH
- See Also:
-
APPLICATION_SRC_PATH
- See Also:
-
APPLICATION_LAUNCHER_PATH
- See Also:
-
-
Constructor Details
-
PythonAnnotationProcessor
public PythonAnnotationProcessor()
-
-
Method Details
-
setClassElementCallback
Set the callback to be invoked for each class element created during processing. This is primarily used for testing purposes.- Parameters:
callback- The callback function
-
setPythonSourceVisitors
Sets visitors for Python source metadata in this compilation.- Parameters:
pythonSourceVisitors- the visitors
-
setCompilePythonBytecode
public void setCompilePythonBytecode(boolean compilePythonBytecode) Set whether generated Python VFS resources should include GraalPy bytecode caches.- Parameters:
compilePythonBytecode- Whether bytecode caches should be emitted- Since:
- 5.2.0
-
init
- Specified by:
initin interfaceProcessor- Overrides:
initin classAbstractInjectAnnotationProcessor
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
process
- Specified by:
processin interfaceProcessor- Specified by:
processin classAbstractProcessor
-
setClassLoader
Sets the class loader used for in-memory compiler execution.- Parameters:
classLoader- The class loader
-