Class InjectionProvider

java.lang.Object
mockit.internal.injection.InjectionProvider
Direct Known Subclasses:
FieldToInject, MockedType

public abstract class InjectionProvider extends Object
Provides type, name, and value(s) for an injection point, which is either a field to be injected or a parameter in the chosen constructor of a tested class.
  • Field Details

    • NULL

      public static final Object NULL
    • declaredType

      @NonNull protected final Type declaredType
    • name

      @NonNull protected final String name
    • parent

      @Nullable public InjectionProvider parent
  • Constructor Details

    • InjectionProvider

      protected InjectionProvider(@NonNull Type declaredType, @NonNull String name)
  • Method Details

    • getDeclaredType

      @NonNull public final Type getDeclaredType()
    • getClassOfDeclaredType

      @NonNull public abstract Class<?> getClassOfDeclaredType()
    • getName

      @NonNull public final String getName()
    • getAnnotations

      @NonNull public Annotation[] getAnnotations()
    • getValue

      @Nullable public Object getValue(@Nullable Object owner)
    • isRequired

      public boolean isRequired()
    • hasAnnotation

      public boolean hasAnnotation(@NonNull Class<? extends Annotation> annotationOfInterest)
    • toString

      public String toString()
      Overrides:
      toString in class Object