Class ExtensionExtractor

java.lang.Object
com.djrapitops.plan.extension.extractor.ExtensionExtractor

public final class ExtensionExtractor extends Object
Implementation detail, for extracting methods from DataExtension.

This class can be used for testing validity of annotation implementations in your unit tests to avoid runtime errors. validateAnnotations()

  • Constructor Details

    • ExtensionExtractor

      public ExtensionExtractor(DataExtension extension)
      Utility for extracting annotations and methods from DataExtension.

      Use with unit tests if necessary.

      Parameters:
      extension - Your DataExtension implementation.
  • Method Details

    • getPluginName

      @Deprecated public static <T extends DataExtension> String getPluginName(Class<T> extensionClass)
      Deprecated.
      Deprecated plugin name get method.
      Type Parameters:
      T - Type of the class
      Parameters:
      extensionClass - Class that has PluginInfo annotation
      Returns:
      Plugin name in PluginInfo annotation.
    • validateAnnotations

      public void validateAnnotations()
      Use this method in an unit test to validate your DataExtension.
      Throws:
      IllegalArgumentException - If an implementation error is found.
    • extractAnnotationInformation

      @Deprecated public void extractAnnotationInformation()
      Deprecated.
      No longer used anywhere, no-op.
    • getWarnings

      public List<String> getWarnings()
      Get list of warnings produced by the parser.

      These will be logged to console when your extension registers.

      Returns:
      List of warning strings.
    • getPluginInfo

      public PluginInfo getPluginInfo()
      Get the plugin info annotation
      Returns:
      Annotation.
    • getTabOrder

      public Optional<TabOrder> getTabOrder()
      Get the TabOrder annotation if present.
      Returns:
      Annotation or empty optional.
    • getTabAnnotations

      public Collection<Tab> getTabAnnotations()
      Get Tab annotations if present.
      Returns:
      Collection of annotations.
    • getTabInformation

      public List<TabInfo> getTabInformation()
      Get the TabInfo annotations if present.
      Returns:
      List of TabInfo annotations.
    • getMethodAnnotations

      @Deprecated public MethodAnnotations getMethodAnnotations()
      Deprecated.
      During refactoring MethodAnnotations was removed. Using getMethods() instead.
      Deprecated method for method annotation access.
      Returns:
      Old utility for method annotation access.
    • getMethods

      Gets the extracted method utilities.
      Returns:
      Method utilities for calling the code.
    • getInvalidateMethodAnnotations

      public List<InvalidateMethod> getInvalidateMethodAnnotations()
      Get list of invalidated methods.
      Returns:
      List of annotations.