Class AbstractResourcesInjector<A extends java.lang.annotation.Annotation>

java.lang.Object
com.adelean.inject.resources.junit.jupiter.core.AbstractResourcesInjector<A>
Direct Known Subclasses:
BinaryResourcesInjector, JsonLinesResourcesInjector, JsonResourcesInjector, PropertiesResourcesInjector, TextResourcesInjector, YamlDocumentsResourcesInjector, YamlResourcesInjector

public abstract class AbstractResourcesInjector<A extends java.lang.annotation.Annotation>
extends java.lang.Object
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.lang.Class<A> annotationType  
    protected InjectionContext injectionContext  
    static java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,​java.lang.Class<? extends AbstractResourcesInjector<? extends java.lang.annotation.Annotation>>> INJECTORS  
    protected java.lang.Class<?> testClass  
    protected java.lang.Object testInstance  
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected AbstractResourcesInjector​(InjectionContext injectionContext, @Nullable java.lang.Object testInstance, java.lang.Class<?> testClass, java.lang.Class<A> annotationType)  
  • Method Summary

    Modifier and Type Method Description
    static java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,​java.lang.Class<? extends AbstractResourcesInjector<? extends java.lang.annotation.Annotation>>> allInjectors()  
    protected void assertValidField​(java.lang.reflect.Field field)  
    void assertValidParameter​(java.lang.reflect.Parameter parameter)  
    void injectField​(java.lang.reflect.Field field)  
    static <T extends java.lang.annotation.Annotation>
    AbstractResourcesInjector<T>
    injectorFor​(java.lang.Class<T> annotationType, @Nullable java.lang.Object testInstance, java.lang.Class<?> testClass, InjectionContext injectionContext)  
    abstract java.lang.Object valueToInject​(java.lang.reflect.Type valueType, A resourceAnnotation)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • INJECTORS

      public static final java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,​java.lang.Class<? extends AbstractResourcesInjector<? extends java.lang.annotation.Annotation>>> INJECTORS
    • injectionContext

      protected final InjectionContext injectionContext
    • testInstance

      protected final java.lang.Object testInstance
    • testClass

      protected final java.lang.Class<?> testClass
    • annotationType

      protected final java.lang.Class<A extends java.lang.annotation.Annotation> annotationType
  • Constructor Details

    • AbstractResourcesInjector

      protected AbstractResourcesInjector​(InjectionContext injectionContext, @Nullable @Nullable java.lang.Object testInstance, java.lang.Class<?> testClass, java.lang.Class<A> annotationType)
  • Method Details

    • injectorFor

      public static <T extends java.lang.annotation.Annotation> AbstractResourcesInjector<T> injectorFor​(java.lang.Class<T> annotationType, @Nullable @Nullable java.lang.Object testInstance, java.lang.Class<?> testClass, InjectionContext injectionContext)
    • injectField

      public void injectField​(java.lang.reflect.Field field)
    • assertValidField

      protected void assertValidField​(java.lang.reflect.Field field)
    • assertValidParameter

      public void assertValidParameter​(java.lang.reflect.Parameter parameter)
    • valueToInject

      public abstract java.lang.Object valueToInject​(java.lang.reflect.Type valueType, A resourceAnnotation)
    • allInjectors

      public static java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,​java.lang.Class<? extends AbstractResourcesInjector<? extends java.lang.annotation.Annotation>>> allInjectors()