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.
  • Constructor Details

    • PluginAnnotationProcessor

      public PluginAnnotationProcessor()
      Creates a new PluginAnnotationProcessor.

      The processor is instantiated by the Java compiler and initialized via init(ProcessingEnvironment).

  • Method Details

    • init

      public void init(ProcessingEnvironment processingEnv)
      Initializes the annotation processor with the provided processing environment.
      Specified by:
      init in interface Processor
      Overrides:
      init in class AbstractProcessor
      Parameters:
      processingEnv - the annotation processing environment
    • getSupportedSourceVersion

      public SourceVersion getSupportedSourceVersion()
      Returns the latest source version supported by this annotation processor.
      Specified by:
      getSupportedSourceVersion in interface Processor
      Overrides:
      getSupportedSourceVersion in class AbstractProcessor
      Returns:
      the latest supported source version
    • process

      public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
      Processes the Plugin annotation to generate the velocity-plugin.json metadata file.

      If multiple plugin classes are found, a warning is issued and only the first is used.

      Specified by:
      process in interface Processor
      Specified by:
      process in class AbstractProcessor
      Parameters:
      annotations - the annotation types requested to be processed
      roundEnv - the environment for information about the current and prior round
      Returns:
      true if the annotations are claimed by this processor, false otherwise