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> T
find(Class<T> type, String symbol)
Descriptor<?>
findDescriptor(Class<?> type, String symbol)
Looks for aDescriptor
that has the given symbolstatic SymbolLookup
get()
Gets the singleton instance.static Set<String>
getSymbolValue(Class<?> c)
Get theSymbol
value(s) for the given class, if the annotation is present.static Set<String>
getSymbolValue(Object o)
Get theSymbol
value(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 aDescriptor
that 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 theSymbol
value(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 itsDescriptor
class instead.- Parameters:
o
- An object- Returns:
- The
Symbol
annotation value(s) for the class (generally aDescriptor
that object represents, or an emptySet
if the annotation is not present.
-
getSymbolValue
@NonNull public static Set<String> getSymbolValue(@NonNull Class<?> c)
Get theSymbol
value(s) for the given class, if the annotation is present. This will get theDescriptor
forDescribable
classes.- Parameters:
c
- A class.- Returns:
- The
Symbol
annotation value(s) for the given class, or an emptySet
if the annotation is not present.
-
-