Annotation Interface AutoRegister


@Target(TYPE) @Retention(CLASS) public @interface AutoRegister
Annotation to mark classes for automatic registration by the plugin. This annotation is used to mark classes that need to be registered during the plugin's startup process.

Classes annotated with this will be processed by the plugin's registration system.

Hint: Use this annotation to register commands, events, or custom items. It should only be used when the class extends CustomItem, SimpleCommand, or Listener.

How the index works: during compilation, the singularitylib-processor annotation processor collects every class annotated with this and writes it into META-INF/singularitylib/auto-register-index.properties inside the built jar. At plugin startup Register reads that index instead of scanning the classpath with Reflections. The annotation keeps CLASS retention so it is always present in compiled class files and visible to the processor.

See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Indicates that the annotated class should be automatically registered by the plugin.
  • Element Details

    • value

      String value
      Indicates that the annotated class should be automatically registered by the plugin. This annotation is used to mark classes that need to be registered during the plugin's startup process.

      Classes annotated with this will be processed by the plugin's registration system.

      Hint: Use this annotation to register commands, events, or custom items. It should only be used when the class extends CustomItem, SimpleCommand, or Listener.

      Returns:
      the registration value, defaults to empty string
      Default:
      ""