public class JqwikReflectionSupport
extends java.lang.Object
| Constructor and Description |
|---|
JqwikReflectionSupport() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Optional<java.lang.reflect.Method> |
findGeneratorMethod(java.lang.String generatorToFind,
java.lang.Class<?> containerClass,
java.lang.Class<? extends java.lang.annotation.Annotation> requiredGeneratorAnnotation,
java.util.function.Function<java.lang.reflect.Method,java.lang.String> generatorNameSupplier,
net.jqwik.api.providers.TypeUsage targetType) |
static java.util.List<java.lang.reflect.Method> |
findMethodsPotentiallyOuter(java.lang.Class<?> clazz,
java.util.function.Predicate<java.lang.reflect.Method> predicate,
org.junit.platform.commons.support.HierarchyTraversalMode traversalMode)
Find all methods as in ReflectionSupport.findMethods(..) but also use outer classes to look for
methods.
|
static java.util.Set<java.nio.file.Path> |
getAllClasspathRootDirectories() |
static java.util.Optional<java.lang.reflect.Method> |
getFunctionMethod(java.lang.Class<?> candidateType) |
static MethodParameter |
getMethodParameter(java.lang.reflect.Parameter parameter,
int index,
java.lang.Class<?> containerClass) |
static java.util.List<MethodParameter> |
getMethodParameters(java.lang.reflect.Method method,
java.lang.Class<?> containerClass) |
static boolean |
hasDefaultConstructor(java.lang.Class<?> aClass) |
static java.lang.Object |
invokeMethodPotentiallyOuter(java.lang.reflect.Method method,
java.lang.Object target,
java.lang.Object... args)
Invoke the supplied method as in ReflectionSupport.invokeMethod(..) but potentially use the outer
instance if the method belongs to the outer instance of an object.
|
static boolean |
isFunctionalType(java.lang.Class<?> candidateType) |
static java.util.function.Predicate<java.lang.reflect.Method> |
isGeneratorMethod(net.jqwik.api.providers.TypeUsage targetType,
java.lang.Class<? extends java.lang.annotation.Annotation> requiredAnnotation) |
static boolean |
isInnerClass(java.lang.Class<?> clazz) |
static boolean |
isNotStatic(java.lang.Class<?> clazz) |
static boolean |
isNotStatic(java.lang.reflect.Member member) |
static boolean |
isStatic(java.lang.Class<?> clazz) |
static boolean |
isStatic(java.lang.reflect.Member member) |
static boolean |
isToStringMethod(java.lang.reflect.Method method) |
static <T> T |
newInstance(java.lang.reflect.Constructor<T> constructor,
java.lang.Object... args) |
static <T> T |
newInstanceInTestContext(java.lang.Class<T> clazz,
java.lang.Object context)
Create instance of a class that can potentially be a non static inner class
and its outer instance might be
context |
static <T> T |
newInstanceWithDefaultConstructor(java.lang.Class<T> clazz)
Create instance of a class that can potentially be a non static inner class
|
static boolean |
returnsVoid(java.lang.reflect.Method method) |
static java.util.stream.Stream<java.lang.Object> |
streamInstancesFromInside(java.lang.Object inner) |
public static java.util.stream.Stream<java.lang.Object> streamInstancesFromInside(java.lang.Object inner)
public static <T> T newInstanceWithDefaultConstructor(java.lang.Class<T> clazz)
T - The type of the instance to createclazz - The class to instantiatepublic static <T> T newInstanceInTestContext(java.lang.Class<T> clazz,
java.lang.Object context)
contextT - The type of the instance to createclazz - The class to instantiatecontext - The potential context instancepublic static <T> T newInstance(java.lang.reflect.Constructor<T> constructor,
java.lang.Object... args)
public static java.util.List<java.lang.reflect.Method> findMethodsPotentiallyOuter(java.lang.Class<?> clazz,
java.util.function.Predicate<java.lang.reflect.Method> predicate,
org.junit.platform.commons.support.HierarchyTraversalMode traversalMode)
clazz - The class in which you start the searchpredicate - The condition to check for all candidate methodstraversalMode - Traverse hierarchy up or down. Determines the order in resulting list.public static java.lang.Object invokeMethodPotentiallyOuter(java.lang.reflect.Method method,
java.lang.Object target,
java.lang.Object... args)
method - The method to invoketarget - The object to invoke the method onargs - The arguments of the method invocationpublic static java.util.Set<java.nio.file.Path> getAllClasspathRootDirectories()
public static java.util.List<MethodParameter> getMethodParameters(java.lang.reflect.Method method, java.lang.Class<?> containerClass)
public static MethodParameter getMethodParameter(java.lang.reflect.Parameter parameter, int index, java.lang.Class<?> containerClass)
public static java.util.Optional<java.lang.reflect.Method> findGeneratorMethod(java.lang.String generatorToFind,
java.lang.Class<?> containerClass,
java.lang.Class<? extends java.lang.annotation.Annotation> requiredGeneratorAnnotation,
java.util.function.Function<java.lang.reflect.Method,java.lang.String> generatorNameSupplier,
net.jqwik.api.providers.TypeUsage targetType)
public static java.util.function.Predicate<java.lang.reflect.Method> isGeneratorMethod(net.jqwik.api.providers.TypeUsage targetType,
java.lang.Class<? extends java.lang.annotation.Annotation> requiredAnnotation)
public static boolean isInnerClass(java.lang.Class<?> clazz)
public static boolean isFunctionalType(java.lang.Class<?> candidateType)
public static java.util.Optional<java.lang.reflect.Method> getFunctionMethod(java.lang.Class<?> candidateType)
public static boolean isToStringMethod(java.lang.reflect.Method method)
public static boolean hasDefaultConstructor(java.lang.Class<?> aClass)
public static boolean isStatic(java.lang.Class<?> clazz)
public static boolean isNotStatic(java.lang.Class<?> clazz)
public static boolean isStatic(java.lang.reflect.Member member)
public static boolean isNotStatic(java.lang.reflect.Member member)
public static boolean returnsVoid(java.lang.reflect.Method method)