Class InjectionTarget
java.lang.Object
honeyroasted.fill.InjectionTarget
Represents a target for a single value injection
-
Constructor Summary
ConstructorsConstructorDescriptionInjectionTarget(honeyroasted.jype.system.JTypeSystem system, Field field) Creates a newInjectionTargetfrom aFieldInjectionTarget(honeyroasted.jype.system.JTypeSystem system, Parameter parameter) Creates a newInjectionTargetfrom a methodParameterInjectionTarget(String name, honeyroasted.jype.type.JType type, Class<?> rawType, List<? extends Annotation> annotations) Creates a newInjectionTarget -
Method Summary
Modifier and TypeMethodDescriptionList<? extends Annotation> <T extends Annotation>
TGets anAnnotationon thisInjectionTargetof the given typebooleanhas(Class<? extends Annotation> cls) Checks if thisInjectionTargethas anAnnotationof the given typename()Class<?> rawType()honeyroasted.jype.type.JTypetype()
-
Constructor Details
-
InjectionTarget
public InjectionTarget(String name, honeyroasted.jype.type.JType type, Class<?> rawType, List<? extends Annotation> annotations) Creates a newInjectionTarget- Parameters:
name- The name of this injection targettype- The type of this injection targetrawType- The rawClasstype of this injection targetannotations- The annotations on this injection target
-
InjectionTarget
Creates a newInjectionTargetfrom aField- Parameters:
system- TheJTypeSystemto use for resolving typesfield- The field to target
-
InjectionTarget
Creates a newInjectionTargetfrom a methodParameter- Parameters:
system- TheJTypeSystemto use for resolving typesparameter- The parameter to target
-
-
Method Details
-
name
- Returns:
- The name of this
InjectionTarget
-
type
public honeyroasted.jype.type.JType type()- Returns:
- The
JTypeof thisInjectionTarget
-
rawType
- Returns:
- The raw
Classtype of thisInjectionTarget
-
annotations
- Returns:
- The
Annotations on thisInjectionTarget
-
has
Checks if thisInjectionTargethas anAnnotationof the given type- Parameters:
cls- The annotation type- Returns:
- True if this target has an annotation of the given type
-
get
Gets anAnnotationon thisInjectionTargetof the given type- Type Parameters:
T- The annotation type- Parameters:
cls- The annotation type- Returns:
- The
Annotation, or null if no annotation of typeTwas found
-