Annotation Interface SpigotBootDiscoveryCategory
Marks an annotation or type as the root of a
DiscoveryIndex category. Downstream
modules apply this meta-annotation to their own annotations or supertypes to extend
discovery without modifying the annotation processor.
Example: classify anything implementing a community module's repository interface.
@SpigotBootDiscoveryCategory(value = "my-plugin.repository", kind = Kind.SUBTYPE)
public interface CommunityRepository<T, ID> { ... }
Example: classify anything annotated with a custom stereotype.
@SpigotBootDiscoveryCategory(value = "my-plugin.handler", kind = Kind.ANNOTATION)
public @interface MyHandler { }
At runtime, query the reader with the same category name:
reader.classesInCategory("my-plugin.repository", basePackage);
RetentionPolicy.CLASS retention is used so the annotation processor can read this
meta-annotation from compiled dependency jars, but the runtime doesn't pay the cost of
loading it into reflective metadata.
-
Nested Class Summary
Nested Classes -
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanForSpigotBootDiscoveryCategory.Kind.ANNOTATIONrules: whentrue, classes annotated with any annotation that is (transitively) meta-annotated with the category-bearing annotation also match — mirroring the classic Spring@Component/@Servicestereotype pattern.
-
Element Details
-
value
String value- Returns:
- the
category keyused to register matching classes. Use a namespaced string (e.g."my-plugin.repository") to avoid clashing with spigot-boot's built-in categories or other community modules.
-
kind
- Returns:
- whether this rule matches annotations on the target class (
SpigotBootDiscoveryCategory.Kind.ANNOTATION) or supertypes of the target class (SpigotBootDiscoveryCategory.Kind.SUBTYPE).
-
-
-
transitive
boolean transitiveForSpigotBootDiscoveryCategory.Kind.ANNOTATIONrules: whentrue, classes annotated with any annotation that is (transitively) meta-annotated with the category-bearing annotation also match — mirroring the classic Spring@Component/@Servicestereotype pattern. Defaultfalsemeans only direct annotations trigger the rule.Ignored for
SpigotBootDiscoveryCategory.Kind.SUBTYPErules (supertype walks are always transitive).- Returns:
trueif transitive meta-annotation matching is enabled;false(default) for direct-annotation-only matching.
- Default:
- false
-