java.lang.Object
com.github.rvesse.airline.help.sections.factories.HelpSectionRegistry

public class HelpSectionRegistry extends Object
Registry which maps annotations to help sections
  • Field Details

  • Constructor Details

    • HelpSectionRegistry

      public HelpSectionRegistry()
  • Method Details

    • 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(Class<? extends 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 Set<Class<? extends Annotation>> getAnnotationClasses()
      Gets all the supported annotation classes that can be translated into help sections
      Returns:
      Annotation classes
    • getHelpSection

      public static HelpSection getHelpSection(Class<? extends Annotation> cls, 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