Top Description Fields Constructors Methods
org.glassfish.hk2.utilities

public Class InjecteeImpl

extends Object
implements Injectee
Class Inheritance
All Implemented Interfaces
org.glassfish.hk2.api.Injectee
Imports
java.lang.annotation.Annotation, java.lang.reflect.AnnotatedElement, .Constructor, .Field, .Method, .Type, java.util.Collections, .Set, org.glassfish.hk2.api.ActiveDescriptor, .Injectee, .Unqualified, org.glassfish.hk2.utilities.reflection.Pretty

This is a writeable version of the Injectee interface. Using this implementation may make your code more portable, as new methods added to the interface will be reflected in this class.
Author
jwells

Field Summary

Modifier and TypeField and Description
private ActiveDescriptor<?>
private boolean
private boolean
private AnnotatedElement
private Class<?>
private int
private Set<Annotation>
private Type
private Unqualified

Constructor Summary

AccessConstructor and Description
public
InjecteeImpl()

None of the fields of the returned object will be set

public
InjecteeImpl(Type
The possibly null required type
requiredType
)

Only the requiredType field will be set

public
InjecteeImpl(Injectee
The non-null Injectee to copy the values from
copyMe
)

This is the copy constructor, which will copy all the values from the incoming Injectee

Method Summary

Modifier and TypeMethod and Description
public Class<?>
getInjecteeClass()

Implements org.glassfish.hk2.api.Injectee.getInjecteeClass.

Returns the parent class for this injectee.

public ActiveDescriptor<?>
getInjecteeDescriptor()

Implements org.glassfish.hk2.api.Injectee.getInjecteeDescriptor.

This returns the ActiveDescriptor of the injectee if it is known

public AnnotatedElement
getParent()

Implements org.glassfish.hk2.api.Injectee.getParent.

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

public int
getPosition()

Implements org.glassfish.hk2.api.Injectee.getPosition.

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

public Set<Annotation>
getRequiredQualifiers()

Implements org.glassfish.hk2.api.Injectee.getRequiredQualifiers.

This is the set of required qualifiers for this injectee.

public Type
getRequiredType()

Implements org.glassfish.hk2.api.Injectee.getRequiredType.

This is the required type of the injectee.

public Unqualified
getUnqualified()

Implements org.glassfish.hk2.api.Injectee.getUnqualified.

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

public boolean
isOptional()

Implements org.glassfish.hk2.api.Injectee.isOptional.

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

public boolean
isSelf()

Implements org.glassfish.hk2.api.Injectee.isSelf.

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

public void
setInjecteeDescriptor(ActiveDescriptor<?>
The injectee to be associated with this injectee
injecteeDescriptor
)

Sets the descriptor to be associated with this injectee

public void
setOptional(boolean
true if this injectee is optional, false if required
optional
)

Sets whether or not this Injectee should be considered optional

public void
setParent(AnnotatedElement
The parent (Field, Constructor or Method) which is the parent of this Injectee
parent
)

This setter sets both the parent and the injecteeClass fields.

public void
setPosition(int
The index position of the parameter, or -1 if descrbing a field
position
)

Sets the position of this Injectee.

public void
setRequiredQualifiers(Set<Annotation>
The non-null set of required qualifiers
requiredQualifiers
)

Sets the required qualifiers for this Injectee

public void
setRequiredType(Type
The required type of this injectee
requiredType
)

Sets the required type of this Injectee

public void
setSelf(boolean
true if this is a self-referencing Injectee, and false otherwise
self
)

Sets whether or not this is a self-referencing injectee

public void
setUnqualified(Unqualified
The unqualified annotation to be associated with this injectee
unqualified
)

Sets the unqualified annotation to be associated with this injectee

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

injecteeDescriptorback to summary
private ActiveDescriptor<?> injecteeDescriptor
isOptionalback to summary
private boolean isOptional
isSelfback to summary
private boolean isSelf
parentback to summary
private AnnotatedElement parent
pClassback to summary
private Class<?> pClass
positionback to summary
private int position
qualifiersback to summary
private Set<Annotation> qualifiers
requiredTypeback to summary
private Type requiredType
unqualifiedback to summary
private Unqualified unqualified

Constructor Detail

InjecteeImplback to summary
public InjecteeImpl()

None of the fields of the returned object will be set

InjecteeImplback to summary
public InjecteeImpl(Type requiredType)

Only the requiredType field will be set

Parameters
requiredType:Type

The possibly null required type

InjecteeImplback to summary
public InjecteeImpl(Injectee copyMe)

This is the copy constructor, which will copy all the values from the incoming Injectee

Parameters
copyMe:Injectee

The non-null Injectee to copy the values from

Method Detail

getInjecteeClassback to summary
public Class<?> getInjecteeClass()

Implements org.glassfish.hk2.api.Injectee.getInjecteeClass.

Doc from org.glassfish.hk2.api.Injectee.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

Annotations
@Override
getInjecteeDescriptorback to summary
public ActiveDescriptor<?> getInjecteeDescriptor()

Implements org.glassfish.hk2.api.Injectee.getInjecteeDescriptor.

Doc from org.glassfish.hk2.api.Injectee.getInjecteeDescriptor.

This returns the ActiveDescriptor of the injectee if it is known

Annotations
@Override
getParentback to summary
public AnnotatedElement getParent()

Implements org.glassfish.hk2.api.Injectee.getParent.

Doc from org.glassfish.hk2.api.Injectee.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

Annotations
@Override
getPositionback to summary
public int getPosition()

Implements org.glassfish.hk2.api.Injectee.getPosition.

Doc from org.glassfish.hk2.api.Injectee.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

Annotations
@Override
getRequiredQualifiersback to summary
public Set<Annotation> getRequiredQualifiers()

Implements org.glassfish.hk2.api.Injectee.getRequiredQualifiers.

Doc from org.glassfish.hk2.api.Injectee.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

Annotations
@Override
getRequiredTypeback to summary
public Type getRequiredType()

Implements org.glassfish.hk2.api.Injectee.getRequiredType.

Doc from org.glassfish.hk2.api.Injectee.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

Annotations
@Override
getUnqualifiedback to summary
public Unqualified getUnqualified()

Implements org.glassfish.hk2.api.Injectee.getUnqualified.

Doc from org.glassfish.hk2.api.Injectee.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.

Annotations
@Override
isOptionalback to summary
public boolean isOptional()

Implements org.glassfish.hk2.api.Injectee.isOptional.

Doc from org.glassfish.hk2.api.Injectee.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

Annotations
@Override
isSelfback to summary
public boolean isSelf()

Implements org.glassfish.hk2.api.Injectee.isSelf.

Doc from org.glassfish.hk2.api.Injectee.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

Annotations
@Override
setInjecteeDescriptorback to summary
public void setInjecteeDescriptor(ActiveDescriptor<?> injecteeDescriptor)

Sets the descriptor to be associated with this injectee

Parameters
injecteeDescriptor:ActiveDescriptor<?>

The injectee to be associated with this injectee

setOptionalback to summary
public void setOptional(boolean optional)

Sets whether or not this Injectee should be considered optional

Parameters
optional:boolean

true if this injectee is optional, false if required

setParentback to summary
public void setParent(AnnotatedElement parent)

This setter sets both the parent and the injecteeClass fields.

Parameters
parent:AnnotatedElement

The parent (Field, Constructor or Method) which is the parent of this Injectee

setPositionback to summary
public void setPosition(int position)

Sets the position of this Injectee. The position represents the index of the parameter, or -1 if this Injectee is describing a field.

Parameters
position:int

The index position of the parameter, or -1 if descrbing a field

setRequiredQualifiersback to summary
public void setRequiredQualifiers(Set<Annotation> requiredQualifiers)

Sets the required qualifiers for this Injectee

Parameters
requiredQualifiers:Set<Annotation>

The non-null set of required qualifiers

setRequiredTypeback to summary
public void setRequiredType(Type requiredType)

Sets the required type of this Injectee

Parameters
requiredType:Type

The required type of this injectee

setSelfback to summary
public void setSelf(boolean self)

Sets whether or not this is a self-referencing injectee

Parameters
self:boolean

true if this is a self-referencing Injectee, and false otherwise

setUnqualifiedback to summary
public void setUnqualified(Unqualified unqualified)

Sets the unqualified annotation to be associated with this injectee

Parameters
unqualified:Unqualified

The unqualified annotation to be associated with this injectee

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.