Package org.jvnet.hk2.internal
Class SystemInjecteeImpl
- java.lang.Object
-
- org.jvnet.hk2.internal.SystemInjecteeImpl
-
-
Field Summary
Fields Modifier and Type Field Description private ActiveDescriptor<?>injecteeDescriptorprivate booleanisOptionalprivate booleanisSelfprivate java.lang.reflect.AnnotatedElementparentprivate java.lang.ObjectparentIdentifierprivate java.lang.Class<?>pClassprivate intpositionprivate java.util.Set<java.lang.annotation.Annotation>qualifiersprivate java.lang.reflect.TyperequiredTypeprivate Unqualifiedunqualified
-
Constructor Summary
Constructors Constructor Description SystemInjecteeImpl(java.lang.reflect.Type requiredType, java.util.Set<java.lang.annotation.Annotation> qualifiers, int position, java.lang.reflect.AnnotatedElement parent, boolean isOptional, boolean isSelf, Unqualified unqualified, ActiveDescriptor<?> injecteeDescriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.lang.Class<?>getInjecteeClass()Returns the parent class for this injectee.ActiveDescriptor<?>getInjecteeDescriptor()This returns the ActiveDescriptor of the injectee if it is knownjava.lang.reflect.AnnotatedElementgetParent()If this Injectee is in a constructor this will return the constructor being injected into.intgetPosition()If this Injectee is a constructor or method parameter, this will return the index of the parameter.java.util.Set<java.lang.annotation.Annotation>getRequiredQualifiers()This is the set of required qualifiers for this injectee.java.lang.reflect.TypegetRequiredType()This is the required type of the injectee.UnqualifiedgetUnqualified()This method returns theUnqualifiedannotation if it is present on the injection point.inthashCode()booleanisOptional()This method returns true if this injection point is annotated with VOptional.booleanisSelf()This method returns true if this injection point is annotated with VSelf.(package private) voidresetInjecteeDescriptor(ActiveDescriptor<?> injecteeDescriptor)java.lang.StringtoString()
-
-
-
Field Detail
-
requiredType
private final java.lang.reflect.Type requiredType
-
qualifiers
private final java.util.Set<java.lang.annotation.Annotation> qualifiers
-
position
private final int position
-
pClass
private final java.lang.Class<?> pClass
-
parent
private final java.lang.reflect.AnnotatedElement parent
-
isOptional
private final boolean isOptional
-
isSelf
private final boolean isSelf
-
unqualified
private final Unqualified unqualified
-
injecteeDescriptor
private ActiveDescriptor<?> injecteeDescriptor
-
parentIdentifier
private final java.lang.Object parentIdentifier
-
-
Constructor Detail
-
SystemInjecteeImpl
SystemInjecteeImpl(java.lang.reflect.Type requiredType, java.util.Set<java.lang.annotation.Annotation> qualifiers, int position, java.lang.reflect.AnnotatedElement parent, boolean isOptional, boolean isSelf, Unqualified unqualified, ActiveDescriptor<?> injecteeDescriptor)
-
-
Method Detail
-
getRequiredType
public java.lang.reflect.Type getRequiredType()
Description copied from interface:InjecteeThis is the required type of the injectee. The object that is injected into this point must be type-safe with regards to this type- Specified by:
getRequiredTypein interfaceInjectee- Returns:
- The type that this injectee is expecting. Any object injected into this injection point must be type-safe with regards to this type
-
getRequiredQualifiers
public java.util.Set<java.lang.annotation.Annotation> getRequiredQualifiers()
Description copied from interface:InjecteeThis is the set of required qualifiers for this injectee. All of these qualifiers must be present on the implementation class of the object that is injected into this injectee. Note that the fields of the annotation must also match- Specified by:
getRequiredQualifiersin interfaceInjectee- Returns:
- Will not return null, but may return an empty set. The set of all qualifiers that must match.
-
getPosition
public int getPosition()
Description copied from interface:InjecteeIf this Injectee is a constructor or method parameter, this will return the index of the parameter. If this Injectee is a field, this will return -1- Specified by:
getPositionin interfaceInjectee- Returns:
- the position of the parameter, or -1 if this is a field
-
getInjecteeClass
public java.lang.Class<?> getInjecteeClass()
Description copied from interface:InjecteeReturns the parent class for this injectee. This is the class of the object that will be injected into. This field may return null if this is from a service lookup- Specified by:
getInjecteeClassin interfaceInjectee- Returns:
- The class of the object that will be injected into
-
getParent
public java.lang.reflect.AnnotatedElement getParent()
Description copied from interface:InjecteeIf this Injectee is in a constructor this will return the constructor being injected into. If this Injectee is in a method this will return the method being injected into. If this injectee represents a field, this will return the field being injected into. This injectee may be neither in which case this will return null
-
isOptional
public boolean isOptional()
Description copied from interface:InjecteeThis method returns true if this injection point is annotated with VOptional. In this case if there is no definition for the injection point in the system it is allowable for the system to merely return null- Specified by:
isOptionalin interfaceInjectee- Returns:
- true if the injection point is annotated with VOptional, false otherwise
-
isSelf
public boolean isSelf()
Description copied from interface:InjecteeThis method returns true if this injection point is annotated with VSelf. In this case the required type must have a raw class ofActiveDescriptor, isOptional must be false and the set of required qualifiers must be empty
-
getUnqualified
public Unqualified getUnqualified()
Description copied from interface:InjecteeThis method returns theUnqualifiedannotation if it is present on the injection point. This can be used to determine what qualifiers should NOT be given to the injection point.- Specified by:
getUnqualifiedin interfaceInjectee- Returns:
- The
Unqualifiedannotation on the injection point, or null if there is noUnqualifiedannotation on the injection point
-
getInjecteeDescriptor
public ActiveDescriptor<?> getInjecteeDescriptor()
Description copied from interface:InjecteeThis returns the ActiveDescriptor of the injectee if it is known- Specified by:
getInjecteeDescriptorin interfaceInjectee- Returns:
- The ActiveDescriptor of the injectee, or null if the parent is not known
-
resetInjecteeDescriptor
void resetInjecteeDescriptor(ActiveDescriptor<?> injecteeDescriptor)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-