Package org.omnifaces.cdi
Class InjectionTargetWrapper<T>
- java.lang.Object
-
- org.omnifaces.cdi.InjectionTargetWrapper<T>
-
- All Implemented Interfaces:
InjectionTarget<T>
,Producer<T>
,FacesWrapper<InjectionTarget<T>>
public class InjectionTargetWrapper<T> extends Object implements InjectionTarget<T>, FacesWrapper<InjectionTarget<T>>
Provides a simple implementation of
InjectionTarget
that can be sub-classed by developers wishing to provide specialized behavior to an existingInjectionTarget
instance. The default implementation of all methods is to call through to the wrappedInjectionTarget
.Usage: extend this class and provide the instance we are wrapping to the overloaded constructor.
- Since:
- 3.6
- Author:
- Bauke Scholtz
-
-
Constructor Summary
Constructors Constructor Description InjectionTargetWrapper(InjectionTarget<T> wrapped)
Construct a injection target wrapper which wraps the given injection target.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose(T instance)
Set<InjectionPoint>
getInjectionPoints()
InjectionTarget<T>
getWrapped()
void
inject(T instance, CreationalContext<T> ctx)
void
postConstruct(T instance)
void
preDestroy(T instance)
T
produce(CreationalContext<T> ctx)
-
-
-
Constructor Detail
-
InjectionTargetWrapper
public InjectionTargetWrapper(InjectionTarget<T> wrapped)
Construct a injection target wrapper which wraps the given injection target.- Parameters:
wrapped
- The injection target to be wrapped.
-
-
Method Detail
-
getWrapped
public InjectionTarget<T> getWrapped()
- Specified by:
getWrapped
in interfaceFacesWrapper<T>
-
getInjectionPoints
public Set<InjectionPoint> getInjectionPoints()
- Specified by:
getInjectionPoints
in interfaceProducer<T>
-
inject
public void inject(T instance, CreationalContext<T> ctx)
- Specified by:
inject
in interfaceInjectionTarget<T>
-
postConstruct
public void postConstruct(T instance)
- Specified by:
postConstruct
in interfaceInjectionTarget<T>
-
preDestroy
public void preDestroy(T instance)
- Specified by:
preDestroy
in interfaceInjectionTarget<T>
-
-