Top Constructors Methods
org.testng.internal.reflect

public Class ReflectionHelper

extends Object
Class Inheritance
Imports
java.lang.annotation.Annotation, java.lang.reflect.Method, .Modifier, java.util.Arrays, .HashSet, .LinkedList, .List, .Set, java.util.stream.Collectors, org.testng.collections.Lists

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static boolean
public static Method[]

Returns:

An array of all locally declared methods or equivalent thereof (such as default methods on Java 8 based interfaces that the given class implements) but excludes the main() method alone.
excludingMain
(Class<?> clazz)

public static <
- The annotation type
T extends Annotation
>
T

Returns:

- Either the annotation if found (or) null.
findAnnotation
(Class<?>
- The class to search for
typedTestClass
,
Class<T>
- The annotation to look for
annotation
)

A helper method that looks for a given annotation in the current class (or) in any of the super classes

private static Set<Class<?>>
private static List<Method>
public static Method[]

Returns:

An array of all locally declared methods or equivalent thereof (such as default methods on Java 8 based interfaces that the given class implements).
getLocalMethods
(Class<?> clazz)

private static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ReflectionHelperback to summary
public ReflectionHelper()

Method Detail

acceptsStringArrayback to summary
private static boolean acceptsStringArray(Method method)
excludingMainback to summary
public static Method[] excludingMain(Class<?> clazz)
Returns:Method[]

An array of all locally declared methods or equivalent thereof (such as default methods on Java 8 based interfaces that the given class implements) but excludes the main() method alone.

findAnnotationback to summary
public static <T extends Annotation> T findAnnotation(Class<?> typedTestClass, Class<T> annotation)

A helper method that looks for a given annotation in the current class (or) in any of the super classes

Parameters
<T>
- The annotation type
typedTestClass:Class<?>

- The class to search for

annotation:Class<T>

- The annotation to look for

Returns:T

- Either the annotation if found (or) null.

getAllInterfacesback to summary
private static Set<Class<?>> getAllInterfaces(Class<?> clazz)
getDefaultMethodsback to summary
private static List<Method> getDefaultMethods(Class<?> clazz)
getLocalMethodsback to summary
public static Method[] getLocalMethods(Class<?> clazz)
Returns:Method[]

An array of all locally declared methods or equivalent thereof (such as default methods on Java 8 based interfaces that the given class implements).

isStaticVoidback to summary
private static boolean isStaticVoid(Method method)