Class NonProducibleInjectionTarget<T>
- java.lang.Object
-
- org.jboss.weld.injection.producer.AbstractProducer<T>
-
- org.jboss.weld.injection.producer.BasicInjectionTarget<T>
-
- org.jboss.weld.injection.producer.NonProducibleInjectionTarget<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
InjectionTarget<T>
,Producer<T>
,org.jboss.weld.manager.api.WeldInjectionTarget<T>
public class NonProducibleInjectionTarget<T> extends BasicInjectionTarget<T>
An implementation ofInjectionTarget
for classes that do not fulfill bean class requirements (e.g. are abstract or non-static inner classes). Instances of these class can be injected using this implementation. If the application attempts toproduce(CreationalContext)
a new instance of the class,CreationException
is thrown.- Author:
- Jozef Hartinger
-
-
Field Summary
-
Fields inherited from class org.jboss.weld.injection.producer.BasicInjectionTarget
beanManager
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkType(EnhancedAnnotatedType<T> type)
static <T> NonProducibleInjectionTarget<T>
create(EnhancedAnnotatedType<T> type, Bean<T> bean, Injector<T> injector, LifecycleCallbackInvoker<T> invoker, BeanManagerImpl beanManager)
static <T> NonProducibleInjectionTarget<T>
create(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager)
boolean
hasDecorators()
boolean
hasInterceptors()
protected Instantiator<T>
initInstantiator(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager, Set<InjectionPoint> injectionPoints)
Returns an instantiator that will be used to create a new instance of a given component.T
produce(CreationalContext<T> ctx)
Causes an instance to be produced via theProducer
.-
Methods inherited from class org.jboss.weld.injection.producer.BasicInjectionTarget
create, createDefault, createNonCdiInterceptor, dispose, getAnnotated, getAnnotatedType, getBean, getBeanManager, getInjectionPoints, getInjector, getInstantiator, getLifecycleCallbackInvoker, getType, initializeAfterBeanDiscovery, inject, postConstruct, preDestroy, setInstantiator, toString
-
Methods inherited from class org.jboss.weld.injection.producer.AbstractProducer
checkDelegateInjectionPoints, equals, hashCode
-
-
-
-
Method Detail
-
create
public static <T> NonProducibleInjectionTarget<T> create(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager)
-
create
public static <T> NonProducibleInjectionTarget<T> create(EnhancedAnnotatedType<T> type, Bean<T> bean, Injector<T> injector, LifecycleCallbackInvoker<T> invoker, BeanManagerImpl beanManager)
-
initInstantiator
protected Instantiator<T> initInstantiator(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager, Set<InjectionPoint> injectionPoints)
Description copied from class:BasicInjectionTarget
Returns an instantiator that will be used to create a new instance of a given component. If the instantiator uses a constructor with injection points, the implementation of theBasicInjectionTarget.initInstantiator(EnhancedAnnotatedType, Bean, BeanManagerImpl, Set)
method is supposed to register all these injection points within the injectionPoints set passed in as a parameter.- Overrides:
initInstantiator
in classBasicInjectionTarget<T>
-
produce
public T produce(CreationalContext<T> ctx)
Description copied from interface:Producer
Causes an instance to be produced via the
Producer
.If the
Producer
represents a class, this will invoke the constructor annotatedInject
if it exists, or the constructor with no parameters otherwise. If the class has interceptors,produce()
is responsible for building the interceptors and decorators of the instance.If the
Producer
represents a producer field or method, this will invoke the producer method on, or access the producer field of, a contextual instance of the bean that declares the producer.- Specified by:
produce
in interfaceProducer<T>
- Overrides:
produce
in classBasicInjectionTarget<T>
- Parameters:
ctx
- TheCreationalContext
to use for the produced object- Returns:
- the instance produced
-
checkType
protected void checkType(EnhancedAnnotatedType<T> type)
- Overrides:
checkType
in classBasicInjectionTarget<T>
-
hasInterceptors
public boolean hasInterceptors()
- Overrides:
hasInterceptors
in classBasicInjectionTarget<T>
-
hasDecorators
public boolean hasDecorators()
- Overrides:
hasDecorators
in classBasicInjectionTarget<T>
-
-