Package org.jenkinsci.plugins.structs
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 Summary
Constructors Constructor Description SymbolLookup()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tfind(Class<T> type, String symbol)Descriptor<?>findDescriptor(Class<?> type, String symbol)Looks for aDescriptorthat has the given symbolstatic SymbolLookupget()Gets the singleton instance.static Set<String>getSymbolValue(Class<?> c)Get theSymbolvalue(s) for the given class, if the annotation is present.static Set<String>getSymbolValue(Object o)Get theSymbolvalue(s) for the class of the given object, generally aDescriptor, if the annotation is present.
-
-
-
Method Detail
-
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 aDescriptorthat has the given symbol- Parameters:
type- Restrict the search to a subset ofDescribable
-
get
public static SymbolLookup get()
Gets the singleton instance.
-
getSymbolValue
@NonNull public static Set<String> getSymbolValue(@NonNull Object o)
Get theSymbolvalue(s) for the class of the given object, generally aDescriptor, if the annotation is present. If the object is in fact aDescribable, we'll use itsDescriptorclass instead.- Parameters:
o- An object- Returns:
- The
Symbolannotation value(s) for the class (generally aDescriptorthat object represents, or an emptySetif the annotation is not present.
-
getSymbolValue
@NonNull public static Set<String> getSymbolValue(@NonNull Class<?> c)
Get theSymbolvalue(s) for the given class, if the annotation is present. This will get theDescriptorforDescribableclasses.- Parameters:
c- A class.- Returns:
- The
Symbolannotation value(s) for the given class, or an emptySetif the annotation is not present.
-
-