Package org.testng.internal.annotations
Interface IAnnotationFinder
-
- All Known Implementing Classes:
JDK15AnnotationFinder
public interface IAnnotationFinder
This interface defines how annotations are found on classes, methods and constructors. It will be implemented by both JDK 1.4 and JDK 5 annotation finders.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <A extends IAnnotation>
AfindAnnotation(java.lang.Class<?> cls, java.lang.Class<A> annotationClass)
<A extends IAnnotation>
AfindAnnotation(java.lang.Class<?> clazz, java.lang.reflect.Method m, java.lang.Class<A> annotationClass)
<A extends IAnnotation>
AfindAnnotation(java.lang.reflect.Constructor<?> cons, java.lang.Class<A> annotationClass)
<A extends IAnnotation>
AfindAnnotation(java.lang.reflect.Method m, java.lang.Class<A> annotationClass)
<A extends IAnnotation>
AfindAnnotation(ConstructorOrMethod com, java.lang.Class<A> annotationClass)
<A extends IAnnotation>
AfindAnnotation(ITestNGMethod m, java.lang.Class<A> annotationClass)
java.lang.String[]
findOptionalValues(java.lang.reflect.Constructor ctor)
java.lang.String[]
findOptionalValues(java.lang.reflect.Method method)
boolean
hasTestInstance(java.lang.reflect.Method method, int i)
-
-
-
Method Detail
-
findAnnotation
<A extends IAnnotation> A findAnnotation(java.lang.Class<?> cls, java.lang.Class<A> annotationClass)
- Parameters:
cls
- - The corresponding class.annotationClass
- - The class on which annotation is to be looked for.- Returns:
- The annotation on the class or null if none found.
-
findAnnotation
<A extends IAnnotation> A findAnnotation(java.lang.reflect.Method m, java.lang.Class<A> annotationClass)
- Parameters:
m
- - The correspondingMethod
annotationClass
- - The class on which annotation is to be looked for.- Returns:
- The annotation on the method. If not found, return the annotation on the declaring class. If not found, return null.
-
findAnnotation
<A extends IAnnotation> A findAnnotation(ITestNGMethod m, java.lang.Class<A> annotationClass)
-
findAnnotation
<A extends IAnnotation> A findAnnotation(ConstructorOrMethod com, java.lang.Class<A> annotationClass)
-
findAnnotation
<A extends IAnnotation> A findAnnotation(java.lang.Class<?> clazz, java.lang.reflect.Method m, java.lang.Class<A> annotationClass)
-
findAnnotation
<A extends IAnnotation> A findAnnotation(java.lang.reflect.Constructor<?> cons, java.lang.Class<A> annotationClass)
- Parameters:
cons
- - The correspondingConstructor
annotationClass
- - The class on which annotation is to be looked for.- Returns:
- The annotation on the method. If not found, return the annotation on the declaring class. If not found, return null.
-
hasTestInstance
boolean hasTestInstance(java.lang.reflect.Method method, int i)
- Returns:
- true if the ith parameter of the given method has the annotation @TestInstance.
-
findOptionalValues
java.lang.String[] findOptionalValues(java.lang.reflect.Method method)
- Returns:
- the @Optional values of this method's parameters (
null
if the parameter isn't optional)
-
findOptionalValues
java.lang.String[] findOptionalValues(java.lang.reflect.Constructor ctor)
- Returns:
- the @Optional values of this method's parameters (
null
if the parameter isn't optional)
-
-