public enum BeanManager extends Enum<BeanManager>
null
, then it's using reflection to get the necessary methods and invoke them.
If you already have a CDI bean manager instance at hands (and thus having a CDI dependency is no problem), then use
Beans
instead.
Enum Constant and Description |
---|
INSTANCE
Returns the lazily loaded enum singleton instance.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
getReference(Class<T> beanClass)
Returns the CDI managed bean instance of the given class, or
null if there is none. |
static BeanManager |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BeanManager[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final BeanManager INSTANCE
public static BeanManager[] values()
for (BeanManager c : BeanManager.values()) System.out.println(c);
public static BeanManager valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant
with the specified nameNullPointerException
- if the argument is nullpublic <T> T getReference(Class<T> beanClass)
null
if there is none.beanClass
- The type of the CDI managed bean instance.null
if there is none.