Class SymbolLookup

java.lang.Object
org.jenkinsci.plugins.structs.SymbolLookup

@Extension public class SymbolLookup extends Object
Finds symbol by its name.
Author:
Kohsuke Kawaguchi
See Also:
  • Symbol.value()
  • Constructor Details

    • SymbolLookup

      public SymbolLookup()
  • Method Details

    • find

      public <T> T find(Class<T> type, String symbol)
      Parameters:
      type - Restrict the search to a subset of extensions.
    • findDescriptor

      public Descriptor<?> findDescriptor(Class<?> type, String symbol)
      Looks for a Descriptor that has the given symbol
      Parameters:
      type - Restrict the search to a subset of Describable
    • get

      public static SymbolLookup get()
      Gets the singleton instance.
    • getSymbolValue

      @NonNull public static Set<String> getSymbolValue(@NonNull Object o)
      Get the Symbol value(s) for the class of the given object, generally a Descriptor, if the annotation is present. If the object is in fact a Describable, we'll use its Descriptor class instead.
      Parameters:
      o - An object
      Returns:
      The Symbol annotation value(s) for the class (generally a Descriptor that object represents, or an empty Set if the annotation is not present.
    • getSymbolValue

      @NonNull public static Set<String> getSymbolValue(@NonNull Class<?> c)
      Get the Symbol value(s) for the given class, if the annotation is present. This will get the Descriptor for Describable classes.
      Parameters:
      c - A class.
      Returns:
      The Symbol annotation value(s) for the given class, or an empty Set if the annotation is not present.