Class AbstractCompositeGeneratorProcessor
- java.lang.Object
-
- javax.annotation.processing.AbstractProcessor
-
- picocli.codegen.annotation.processing.AbstractCommandSpecProcessor
-
- picocli.codegen.aot.graalvm.processor.AbstractCompositeGeneratorProcessor
-
- All Implemented Interfaces:
javax.annotation.processing.Processor
- Direct Known Subclasses:
NativeImageConfigGeneratorProcessor
abstract class AbstractCompositeGeneratorProcessor extends AbstractCommandSpecProcessor
Base class for writing annotation processors that do something withCommandSpec
models. The model is built up once, and from this model, multiple files can be generated. The generation part is delegated toIGenerator
implementations.- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Map<javax.lang.model.element.Element,CommandLine.Model.CommandSpec>
allCommands
protected java.util.List<IGenerator>
generators
-
Fields inherited from class picocli.codegen.annotation.processing.AbstractCommandSpecProcessor
processingEnv
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCompositeGeneratorProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
handleCommands(java.util.Map<javax.lang.model.element.Element,CommandLine.Model.CommandSpec> commands, java.util.Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment roundEnv)
Subclasses must implement this method and do something with theCommandSpec
command model objects that were found during compilation.-
Methods inherited from class picocli.codegen.annotation.processing.AbstractCommandSpecProcessor
error, fatalError, getSupportedAnnotationTypes, getSupportedSourceVersion, init, logInfo, process, warn
-
-
-
-
Field Detail
-
allCommands
java.util.Map<javax.lang.model.element.Element,CommandLine.Model.CommandSpec> allCommands
-
generators
protected java.util.List<IGenerator> generators
-
-
Method Detail
-
handleCommands
protected boolean handleCommands(java.util.Map<javax.lang.model.element.Element,CommandLine.Model.CommandSpec> commands, java.util.Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment roundEnv)
Description copied from class:AbstractCommandSpecProcessor
Subclasses must implement this method and do something with theCommandSpec
command model objects that were found during compilation.- Specified by:
handleCommands
in classAbstractCommandSpecProcessor
- Parameters:
commands
- a map of annotated elements to their associatedCommandSpec
. Note that the key set may contain classes that do not have a@Command
annotation but were added to the map because the class has fields annotated withOption
or@Parameters
.annotations
- the annotation types requested to be processedroundEnv
- environment for information about the current and prior round- Returns:
- whether or not the set of annotation types are claimed by this processor.
If
true
is returned, the annotation types are claimed and subsequent processors will not be asked to process them; iffalse
is returned, the annotation types are unclaimed and subsequent processors may be asked to process them. A processor may always return the same boolean value or may vary the result based on chosen criteria.
-
-