Top Description Methods
org.glassfish.hk2.api

public Interface Injectee

Known Direct Implementers
org.glassfish.hk2.utilities.InjecteeImpl
Imports
java.lang.annotation.Annotation, java.lang.reflect.AnnotatedElement, .Type, java.util.Set

An Injectee represents the point of injection. It can be used by injection resolvers to discover all of the information available about the entity being injected into.
Author
jwells

Method Summary

Modifier and TypeMethod and Description
public Class<?>

Returns:

The class of the object that will be injected into
getInjecteeClass
()

Returns the parent class for this injectee.

public ActiveDescriptor<?>

Returns:

The ActiveDescriptor of the injectee, or null if the parent is not known
getInjecteeDescriptor
()

This returns the ActiveDescriptor of the injectee if it is known

public AnnotatedElement

Returns:

The parent of the injectee, which may be null
getParent
()

If this Injectee is in a constructor this will return the constructor being injected into.

public int

Returns:

the position of the parameter, or -1 if this is a field
getPosition
()

If this Injectee is a constructor or method parameter, this will return the index of the parameter.

public Set<Annotation>

Returns:

Will not return null, but may return an empty set. The set of all qualifiers that must match.
getRequiredQualifiers
()

This is the set of required qualifiers for this injectee.

public Type

Returns:

The type that this injectee is expecting. Any object injected into this injection point must be type-safe with regards to this type
getRequiredType
()

This is the required type of the injectee.

public Unqualified

Returns:

The Unqualified annotation on the injection point, or null if there is no Unqualified annotation on the injection point
getUnqualified
()

This method returns the Unqualified annotation if it is present on the injection point.

public boolean

Returns:

true if the injection point is annotated with VOptional, false otherwise
isOptional
()

This method returns true if this injection point is annotated with VOptional.

public boolean

Returns:

true if the injection point is annotated with VSelf, false otherwise
isSelf
()

This method returns true if this injection point is annotated with VSelf.

Method Detail

getInjecteeClassback to summary
public Class<?> getInjecteeClass()

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

Returns:Class<?>

The class of the object that will be injected into

getInjecteeDescriptorback to summary
public ActiveDescriptor<?> getInjecteeDescriptor()

This returns the ActiveDescriptor of the injectee if it is known

Returns:ActiveDescriptor<?>

The ActiveDescriptor of the injectee, or null if the parent is not known

getParentback to summary
public AnnotatedElement getParent()

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

Returns:AnnotatedElement

The parent of the injectee, which may be null

getPositionback to summary
public int getPosition()

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

Returns:int

the position of the parameter, or -1 if this is a field

getRequiredQualifiersback to summary
public Set<Annotation> getRequiredQualifiers()

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

Returns:Set<Annotation>

Will not return null, but may return an empty set. The set of all qualifiers that must match.

getRequiredTypeback to summary
public Type getRequiredType()

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

Returns:Type

The type that this injectee is expecting. Any object injected into this injection point must be type-safe with regards to this type

getUnqualifiedback to summary
public Unqualified getUnqualified()

This method returns the Unqualified 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.

Returns:Unqualified

The Unqualified annotation on the injection point, or null if there is no Unqualified annotation on the injection point

isOptionalback to summary
public boolean isOptional()

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

Returns:boolean

true if the injection point is annotated with VOptional, false otherwise

isSelfback to summary
public boolean isSelf()

This method returns true if this injection point is annotated with VSelf. In this case the required type must have a raw class of ActiveDescriptor, isOptional must be false and the set of required qualifiers must be empty

Returns:boolean

true if the injection point is annotated with VSelf, false otherwise