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
Modifier and TypeMethodDescription<A extends IAnnotation>
AfindAnnotation
(Class<?> cls, Class<A> annotationClass) <A extends IAnnotation>
AfindAnnotation
(Class<?> clazz, Method m, Class<A> annotationClass) <A extends IAnnotation>
AfindAnnotation
(Constructor<?> cons, Class<A> annotationClass) <A extends IAnnotation>
AfindAnnotation
(Method m, Class<A> annotationClass) <A extends IAnnotation>
AfindAnnotation
(ConstructorOrMethod com, Class<A> annotationClass) <A extends IAnnotation>
AfindAnnotation
(ITestNGMethod m, Class<A> annotationClass) <A extends IAnnotation>
List<A>findInheritedAnnotations
(Class<?> cls, Class<A> annotationClass) String[]
findOptionalValues
(Constructor<?> ctor) String[]
findOptionalValues
(Method method) boolean
hasTestInstance
(Method method, int i)
-
Method Details
-
findAnnotation
- Type Parameters:
A
- The expectedIAnnotation
type- 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
- Type Parameters:
A
- The expectedIAnnotation
type- 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
-
findAnnotation
-
findAnnotation
-
findAnnotation
- Type Parameters:
A
- The expectedIAnnotation
type- 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.
-
findInheritedAnnotations
- Type Parameters:
A
- - The expectedIAnnotation
type- Parameters:
cls
- - The corresponding class.annotationClass
- - The class on which annotation is to be looked for.- Returns:
- The annotations on the inherited interfaces. If not found, return the annotations on the declaring interface. If not found, return an empty list.
-
hasTestInstance
- Parameters:
method
- TheMethod
i
- The parameter index- Returns:
- true if the ith parameter of the given method has the annotation @TestInstance.
-
findOptionalValues
- Parameters:
method
- TheMethod
- Returns:
- the @Optional values of this method's parameters (
null
if the parameter isn't optional)
-
findOptionalValues
- Parameters:
ctor
- TheConstructor
- Returns:
- the @Optional values of this method's parameters (
null
if the parameter isn't optional)
-