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 ofInjectionTargetfor 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,CreationExceptionis 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 voidcheckType(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)booleanhasDecorators()booleanhasInterceptors()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.Tproduce(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:BasicInjectionTargetReturns 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:
initInstantiatorin classBasicInjectionTarget<T>
-
produce
public T produce(CreationalContext<T> ctx)
Description copied from interface:ProducerCauses an instance to be produced via the
Producer.If the
Producerrepresents a class, this will invoke the constructor annotatedInjectif 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
Producerrepresents 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:
producein interfaceProducer<T>- Overrides:
producein classBasicInjectionTarget<T>- Parameters:
ctx- TheCreationalContextto use for the produced object- Returns:
- the instance produced
-
checkType
protected void checkType(EnhancedAnnotatedType<T> type)
- Overrides:
checkTypein classBasicInjectionTarget<T>
-
hasInterceptors
public boolean hasInterceptors()
- Overrides:
hasInterceptorsin classBasicInjectionTarget<T>
-
hasDecorators
public boolean hasDecorators()
- Overrides:
hasDecoratorsin classBasicInjectionTarget<T>
-
-