Class HelpSectionRegistry


  • public class HelpSectionRegistry
    extends java.lang.Object
    Registry which maps annotations to help sections
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,​HelpSectionFactory> FACTORIES  
      private static boolean init  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addFactory​(java.lang.Class<? extends java.lang.annotation.Annotation> cls, HelpSectionFactory factory)
      Registers a help section factory for a given annotation class
      static java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getAnnotationClasses()
      Gets all the supported annotation classes that can be translated into help sections
      static HelpSection getHelpSection​(java.lang.Class<? extends java.lang.annotation.Annotation> cls, java.lang.annotation.Annotation annotation)
      Given an annotation returns a help section if the annotation can be translated into one by any of the registered factories
      (package private) static void init()  
      static void reset()
      Resets the registry causing it to re-invoke ServiceLoader.load(Class) to reload declared services
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • FACTORIES

        private static final java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,​HelpSectionFactory> FACTORIES
      • init

        private static boolean init
    • Constructor Detail

      • HelpSectionRegistry

        public HelpSectionRegistry()
    • Method Detail

      • init

        static void init()
      • reset

        public static void reset()
        Resets the registry causing it to re-invoke ServiceLoader.load(Class) to reload declared services
      • addFactory

        public static void addFactory​(java.lang.Class<? extends java.lang.annotation.Annotation> cls,
                                      HelpSectionFactory factory)
        Registers a help section factory for a given annotation class
        Parameters:
        cls - Annotation class
        factory - Help section factory
      • getAnnotationClasses

        public static java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getAnnotationClasses()
        Gets all the supported annotation classes that can be translated into help sections
        Returns:
        Annotation classes
      • getHelpSection

        public static HelpSection getHelpSection​(java.lang.Class<? extends java.lang.annotation.Annotation> cls,
                                                 java.lang.annotation.Annotation annotation)
        Given an annotation returns a help section if the annotation can be translated into one by any of the registered factories
        Parameters:
        cls - Annotation class
        annotation - Annotation instance
        Returns:
        Help Section or null if the annotation does not denote a help section