Class SymbolLookup


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

      • SymbolLookup

        public SymbolLookup()
    • Method Detail

      • find

        public <T> T find​(Class<T> type,
                          String symbol)
        Parameters:
        type - Restrict the search to a subset of extensions.
      • 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.