Package org.int4.dirk.library
Class SetInjectionTargetExtension<T>
- java.lang.Object
-
- org.int4.dirk.library.SetInjectionTargetExtension<T>
-
- Type Parameters:
T- the type of element in the collection
- All Implemented Interfaces:
InjectionTargetExtension<java.util.Set<T>,T>
public class SetInjectionTargetExtension<T> extends java.lang.Object implements InjectionTargetExtension<java.util.Set<T>,T>
AnInjectionTargetExtensionforSets.
-
-
Constructor Summary
Constructors Constructor Description SetInjectionTargetExtension()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.reflect.TypegetElementType(java.lang.reflect.Type type)Returns the element type of the given type by unwrapping the given type.java.util.Set<T>getInstance(InstantiationContext<T> context)Creates an instance of typeTusing the givenInstantiationContext.java.lang.Class<?>getTargetClass()Returns the target class extended by this extension.java.util.Set<TypeTrait>getTypeTraits()Returns theTypeTraits of this extension.
-
-
-
Method Detail
-
getTargetClass
public java.lang.Class<?> getTargetClass()
Description copied from interface:InjectionTargetExtensionReturns the target class extended by this extension.- Specified by:
getTargetClassin interfaceInjectionTargetExtension<java.util.Set<T>,T>- Returns:
- a
Class, nevernull
-
getElementType
public java.lang.reflect.Type getElementType(java.lang.reflect.Type type)
Description copied from interface:InjectionTargetExtensionReturns the element type of the given type by unwrapping the given type. Returningnullor the same type is not allowed.- Specified by:
getElementTypein interfaceInjectionTargetExtension<java.util.Set<T>,T>- Parameters:
type- aTypeto unwrap, cannot benull- Returns:
- the element type of the given type by unwrapping the given type, never
null
-
getTypeTraits
public java.util.Set<TypeTrait> getTypeTraits()
Description copied from interface:InjectionTargetExtensionReturns theTypeTraits of this extension.- Specified by:
getTypeTraitsin interfaceInjectionTargetExtension<java.util.Set<T>,T>- Returns:
- a set of
TypeTrait, nevernullor containsnull, but can be empty
-
getInstance
public java.util.Set<T> getInstance(InstantiationContext<T> context) throws CreationException
Description copied from interface:InjectionTargetExtensionCreates an instance of typeTusing the givenInstantiationContext. Returningnullis allowed to indicate the absence of a value. Depending on the destination where the value is used this can meannullis injected (methods and constructors), that the value is not injected (fields) or that anUnsatisfiedResolutionExceptionis thrown (direct instance resolver call).- Specified by:
getInstancein interfaceInjectionTargetExtension<java.util.Set<T>,T>- Parameters:
context- anInstantiationContext, cannot benull- Returns:
- an instance of type
T, can benull - Throws:
CreationException- when the instance could not be created
-
-