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>annotationTypeprotected InjectionContextinjectionContextstatic java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.Class<? extends AbstractResourcesInjector<? extends java.lang.annotation.Annotation>>>INJECTORSprotected java.lang.Class<?>testClassprotected java.lang.ObjecttestInstance -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractResourcesInjector(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 voidassertValidField(java.lang.reflect.Field field)voidassertValidParameter(java.lang.reflect.Parameter parameter)voidinjectField(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.ObjectvalueToInject(java.lang.reflect.Type valueType, A resourceAnnotation)
-
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
-
testInstance
protected final java.lang.Object testInstance -
testClass
protected final java.lang.Class<?> testClass -
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()
-