Class PluginAnnotationProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
com.velocitypowered.api.plugin.ap.PluginAnnotationProcessor
- All Implemented Interfaces:
Processor
@AutoService(javax.annotation.processing.Processor.class)
@SupportedAnnotationTypes("com.velocitypowered.api.plugin.Plugin")
public class PluginAnnotationProcessor
extends AbstractProcessor
Annotation processor for Velocity.
-
Field Summary
Fields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the latest source version supported by this annotation processor.voidinit(ProcessingEnvironment processingEnv) Initializes the annotation processor with the provided processing environment.booleanprocess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) Processes thePluginannotation to generate thevelocity-plugin.jsonmetadata file.Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, isInitialized
-
Constructor Details
-
PluginAnnotationProcessor
public PluginAnnotationProcessor()Creates a newPluginAnnotationProcessor.The processor is instantiated by the Java compiler and initialized via
init(ProcessingEnvironment).
-
-
Method Details
-
init
Initializes the annotation processor with the provided processing environment.- Specified by:
initin interfaceProcessor- Overrides:
initin classAbstractProcessor- Parameters:
processingEnv- the annotation processing environment
-
getSupportedSourceVersion
Returns the latest source version supported by this annotation processor.- Specified by:
getSupportedSourceVersionin interfaceProcessor- Overrides:
getSupportedSourceVersionin classAbstractProcessor- Returns:
- the latest supported source version
-
process
Processes thePluginannotation to generate thevelocity-plugin.jsonmetadata file.If multiple plugin classes are found, a warning is issued and only the first is used.
- Specified by:
processin interfaceProcessor- Specified by:
processin classAbstractProcessor- Parameters:
annotations- the annotation types requested to be processedroundEnv- the environment for information about the current and prior round- Returns:
trueif the annotations are claimed by this processor,falseotherwise
-