Annotation Type IndexSubclasses


  • @Documented
    @Retention(RUNTIME)
    @Target({TYPE,PACKAGE})
    public @interface IndexSubclasses
    Index all subclasses of the annotated class or package.

    During compilation ClassIndexProcessor creates a resource files listing all classes extending annotated class or located inside annotated package.

    You can retrieve the list at runtime using either ClassIndex.getSubclasses(Class) or ClassIndex.getPackageClasses(String).

    For subclasses of the annotated class the resource file name is compatible with what ServiceLoader expects. So if all the subclasses have a zero-argument constructor you can use ServiceLoader. For subclasses of given package index file is named "jaxb.index", it is located inside the package folder and it's format is compatible with what JAXBContext.newInstance(String) expects.

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean storeJavadoc
      Specifies whether to store Javadoc for runtime retrieval.
    • Element Detail

      • storeJavadoc

        boolean storeJavadoc
        Specifies whether to store Javadoc for runtime retrieval.

        You can retrieve the stored Javadoc summary using ClassIndex.getClassSummary(Class).

        Default:
        false