Package net.jqwik.engine.support
Klasse JqwikReflectionSupport
java.lang.Object
net.jqwik.engine.support.JqwikReflectionSupport
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic Class<?> extractRawType(Type parameterizedType) static <T> Constructor<T> findConstructor(Class<T> type, Class<?>... parameterTypes) findFieldsPotentiallyOuter(Class<?> clazz, Predicate<Field> predicate, org.junit.platform.commons.support.HierarchyTraversalMode traversalMode) Find all field but also use outer classes to look for methods.findGeneratorMethod(String generatorToFind, Class<?> containerClass, Class<? extends Annotation> requiredGeneratorAnnotation, Function<Method, String> generatorNameSupplier, net.jqwik.api.providers.TypeUsage expectedReturnType) findMethodsPotentiallyOuter(Class<?> clazz, Predicate<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.getFunctionMethod(Class<?> candidateType) static MethodParametergetMethodParameter(Parameter parameter, int index, Class<?> containerClass) static List<MethodParameter> getMethodParameters(Executable method, Class<?> containerClass) static booleanhasConstructor(Class<?> aClass, Class<?>... parameterTypes) static booleanhasDefaultConstructor(Class<?> aClass) static booleanimplementsMethod(Class<?> aClass, String methodName, Class<?>[] parameterTypes, Class<?> ignoreImplementationClass) static ObjectinvokeMethodOnContainer(Method method, List<Object> instances, Object... args) Invoke the supplied method as in ReflectionSupport.invokeMethod(..) but potentially use outer instances if the method belongs to the outer instances of an object.static booleanisEqualsMethod(Method method) static booleanisFunctionalType(Class<?> candidateType) static booleanisHashCodeMethod(Method method) static booleanisInnerClass(Class<?> clazz) static booleanstatic booleanisNotStatic(Class<?> clazz) static booleanisNotStatic(Member member) static booleanstatic booleanstatic booleanstatic booleanisToStringMethod(Method method) static <T> TnewInstance(Constructor<T> constructor, Object... args) static <T> TnewInstanceInTestContext(Class<T> clazz, Object context) Create instance of a class that can potentially be a non static inner class and its outer instance might becontextnewInstancesWithDefaultConstructor(Class<?> clazz) Create instance of a class that can potentially be a non static inner classstatic <T> TnewInstanceWithDefaultConstructor(Class<T> clazz) Create instance of a class that can potentially be a non static inner classstatic ObjectreadFieldOnContainer(Field field, List<Object> targetInstances) Read a field's value as in ReflectionSupport.getField(..) but potentially use outer instances if the field belongs to an inner class.static booleanreturnsVoid(Method method) static voidsetFieldOnContainer(Field field, Object value, List<Object> targetInstances) Set a field's value as in ReflectionSupport.setField(..) but potentially use outer instances if the field belongs to an inner class.
-
Konstruktordetails
-
JqwikReflectionSupport
public JqwikReflectionSupport()
-
-
Methodendetails
-
newInstanceWithDefaultConstructor
Create instance of a class that can potentially be a non static inner class- Typparameter:
T- The type of the instance to create- Parameter:
clazz- The class to instantiate- Gibt zurück:
- the newly created instance
-
newInstancesWithDefaultConstructor
Create instance of a class that can potentially be a non static inner class- Parameter:
clazz- The class to instantiate- Gibt zurück:
- all newly created instances with from most outer to most inner
-
newInstanceInTestContext
Create instance of a class that can potentially be a non static inner class and its outer instance might becontext- Typparameter:
T- The type of the instance to create- Parameter:
clazz- The class to instantiatecontext- The potential context instance- Gibt zurück:
- the newly created instance
-
newInstance
-
findMethodsPotentiallyOuter
public static List<Method> findMethodsPotentiallyOuter(Class<?> clazz, Predicate<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.Duplicate methods (through) inheritance are de-duplicated. The first occurrence of a method is kept.
- Parameter:
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.- Gibt zurück:
- List of found methods
-
findFieldsPotentiallyOuter
public static List<Field> findFieldsPotentiallyOuter(Class<?> clazz, Predicate<Field> predicate, org.junit.platform.commons.support.HierarchyTraversalMode traversalMode) Find all field but also use outer classes to look for methods.- Parameter:
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.- Gibt zurück:
- List of found fields
-
readFieldOnContainer
Read a field's value as in ReflectionSupport.getField(..) but potentially use outer instances if the field belongs to an inner class.- Parameter:
field- The field to readtargetInstances- The container instances to read the field from, from outermost to innermost- Gibt zurück:
- The value of the field
-
setFieldOnContainer
Set a field's value as in ReflectionSupport.setField(..) but potentially use outer instances if the field belongs to an inner class.- Parameter:
field- The field to setvalue- The value to set in the fieldtargetInstances- The container instances to set the field on, from outermost to innermost
-
invokeMethodOnContainer
Invoke the supplied method as in ReflectionSupport.invokeMethod(..) but potentially use outer instances if the method belongs to the outer instances of an object.- Parameter:
method- The method to invokeinstances- The container instances to invoke the method on, from outermost to innermostargs- The arguments of the method invocation- Gibt zurück:
- Result of method invocation if there is one, otherwise null
-
getAllClasspathRootDirectories
-
getMethodParameters
-
getMethodParameter
public static MethodParameter getMethodParameter(Parameter parameter, int index, Class<?> containerClass) -
findGeneratorMethod
-
findConstructor
-
isInnerClass
-
isFunctionalType
-
getFunctionMethod
-
isEqualsMethod
-
isToStringMethod
-
isHashCodeMethod
-
hasDefaultConstructor
-
hasConstructor
-
isJava9orAbove
public static boolean isJava9orAbove() -
isStatic
-
isPrivate
-
isNotStatic
-
isStatic
-
isNotStatic
-
returnsVoid
-
implementsMethod
-
extractRawType
-