Top Description Fields Constructors Methods
org.jvnet.hk2.internal

public Class SystemInjecteeImpl

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, .ParameterizedType, .Type, .TypeVariable, java.util.Collections, .Set, org.glassfish.hk2.api.ActiveDescriptor, .Injectee, .Unqualified, org.glassfish.hk2.utilities.reflection.Pretty, .ReflectionHelper

This is an implementation of Injectee that is used by the system.
Author
jwells

Field Summary

Modifier and TypeField and Description
private 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

AccessConstructor and Description
pack-priv
SystemInjecteeImpl(Type requiredType, Set<Annotation> qualifiers, int position, AnnotatedElement parent, boolean isOptional, boolean isSelf, Unqualified unqualified, ActiveDescriptor<?> injecteeDescriptor)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object o)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

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 int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

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.

pack-priv void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

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

Constructor Detail

SystemInjecteeImplback to summary
pack-priv SystemInjecteeImpl(Type requiredType, Set<Annotation> qualifiers, int position, AnnotatedElement parent, boolean isOptional, boolean isSelf, Unqualified unqualified, ActiveDescriptor<?> injecteeDescriptor)

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
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
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
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
resetInjecteeDescriptorback to summary
pack-priv void resetInjecteeDescriptor(ActiveDescriptor<?> injecteeDescriptor)
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.

Annotations
@Override