Package org.jvnet.hk2.internal
Class SystemInjecteeImpl
java.lang.Object
org.jvnet.hk2.internal.SystemInjecteeImpl
- All Implemented Interfaces:
Injectee
This is an implementation of Injectee that is used by the system.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ActiveDescriptor
<?> private final boolean
private final boolean
private final AnnotatedElement
private final Object
private final Class
<?> private final int
private final Set
<Annotation> private final Type
private final Unqualified
-
Constructor Summary
ConstructorsConstructorDescriptionSystemInjecteeImpl
(Type requiredType, Set<Annotation> qualifiers, int position, AnnotatedElement parent, boolean isOptional, boolean isSelf, Unqualified unqualified, ActiveDescriptor<?> injecteeDescriptor) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Class
<?> Returns the parent class for this injectee.This returns the ActiveDescriptor of the injectee if it is knownIf this Injectee is in a constructor this will return the constructor being injected into.int
If this Injectee is a constructor or method parameter, this will return the index of the parameter.This is the set of required qualifiers for this injectee.This is the required type of the injectee.This method returns theUnqualified
annotation if it is present on the injection point.int
hashCode()
boolean
This method returns true if this injection point is annotated with VOptional.boolean
isSelf()
This method returns true if this injection point is annotated with VSelf.(package private) void
resetInjecteeDescriptor
(ActiveDescriptor<?> injecteeDescriptor) toString()
-
Field Details
-
requiredType
-
qualifiers
-
position
private final int position -
pClass
-
parent
-
isOptional
private final boolean isOptional -
isSelf
private final boolean isSelf -
unqualified
-
injecteeDescriptor
-
parentIdentifier
-
-
Constructor Details
-
SystemInjecteeImpl
SystemInjecteeImpl(Type requiredType, Set<Annotation> qualifiers, int position, AnnotatedElement parent, boolean isOptional, boolean isSelf, Unqualified unqualified, ActiveDescriptor<?> injecteeDescriptor)
-
-
Method Details
-
getRequiredType
Description copied from interface:Injectee
This 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:
getRequiredType
in 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
Description copied from interface:Injectee
This 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:
getRequiredQualifiers
in 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:Injectee
If 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:
getPosition
in interfaceInjectee
- Returns:
- the position of the parameter, or -1 if this is a field
-
getInjecteeClass
Description copied from interface:Injectee
Returns 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:
getInjecteeClass
in interfaceInjectee
- Returns:
- The class of the object that will be injected into
-
getParent
Description copied from interface:Injectee
If 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:Injectee
This 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:
isOptional
in interfaceInjectee
- Returns:
- true if the injection point is annotated with VOptional, false otherwise
-
isSelf
public boolean isSelf()Description copied from interface:Injectee
This 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
Description copied from interface:Injectee
This method returns theUnqualified
annotation 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:
getUnqualified
in interfaceInjectee
- Returns:
- The
Unqualified
annotation on the injection point, or null if there is noUnqualified
annotation on the injection point
-
getInjecteeDescriptor
Description copied from interface:Injectee
This returns the ActiveDescriptor of the injectee if it is known- Specified by:
getInjecteeDescriptor
in interfaceInjectee
- Returns:
- The ActiveDescriptor of the injectee, or null if the parent is not known
-
resetInjecteeDescriptor
-
hashCode
public int hashCode() -
equals
-
toString
-