Class SystemInjecteeImpl

java.lang.Object
org.jvnet.hk2.internal.SystemInjecteeImpl
All Implemented Interfaces:
Injectee

public class SystemInjecteeImpl extends Object implements Injectee
This is an implementation of Injectee that is used by the system.
  • Field Details

    • requiredType

      private final Type requiredType
    • qualifiers

      private final Set<Annotation> qualifiers
    • position

      private final int position
    • pClass

      private final Class<?> pClass
    • parent

      private final AnnotatedElement parent
    • isOptional

      private final boolean isOptional
    • isSelf

      private final boolean isSelf
    • unqualified

      private final Unqualified unqualified
    • injecteeDescriptor

      private ActiveDescriptor<?> injecteeDescriptor
    • parentIdentifier

      private final Object parentIdentifier
  • Constructor Details

  • Method Details

    • getRequiredType

      public Type 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 interface Injectee
      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 Set<Annotation> 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 interface Injectee
      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 interface Injectee
      Returns:
      the position of the parameter, or -1 if this is a field
    • getInjecteeClass

      public Class<?> 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 interface Injectee
      Returns:
      The class of the object that will be injected into
    • getParent

      public AnnotatedElement 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
      Specified by:
      getParent in interface Injectee
      Returns:
      The parent of the injectee, which may be 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 interface Injectee
      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 of ActiveDescriptor, isOptional must be false and the set of required qualifiers must be empty
      Specified by:
      isSelf in interface Injectee
      Returns:
      true if the injection point is annotated with VSelf, false otherwise
    • getUnqualified

      public Unqualified getUnqualified()
      Description copied from interface: Injectee
      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.
      Specified by:
      getUnqualified in interface Injectee
      Returns:
      The Unqualified annotation on the injection point, or null if there is no Unqualified annotation on the injection point
    • getInjecteeDescriptor

      public ActiveDescriptor<?> getInjecteeDescriptor()
      Description copied from interface: Injectee
      This returns the ActiveDescriptor of the injectee if it is known
      Specified by:
      getInjecteeDescriptor in interface Injectee
      Returns:
      The ActiveDescriptor of the injectee, or null if the parent is not known
    • resetInjecteeDescriptor

      void resetInjecteeDescriptor(ActiveDescriptor<?> injecteeDescriptor)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object