Package org.testng.internal.annotations
Interface IAnnotationFinder
-
- All Known Implementing Classes:
JDK15AnnotationFinder
public interface IAnnotationFinderThis 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.- Author:
- Cedric Beust
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <A extends IAnnotation>
AfindAnnotation(Class<?> cls, 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)String[]findOptionalValues(Constructor ctor)String[]findOptionalValues(Method method)booleanhasTestInstance(Method method, int i)
-
-
-
Method Detail
-
findAnnotation
<A extends IAnnotation> A findAnnotation(Class<?> cls, Class<A> annotationClass)
- Parameters:
cls-annotationClass-- Returns:
- The annotation on the class or null if none found.
-
findAnnotation
<A extends IAnnotation> A findAnnotation(Method m, Class<A> annotationClass)
- Parameters:
m-annotationClass-- 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, Class<A> annotationClass)
-
findAnnotation
<A extends IAnnotation> A findAnnotation(ConstructorOrMethod com, Class<A> annotationClass)
-
findAnnotation
<A extends IAnnotation> A findAnnotation(Constructor<?> cons, Class<A> annotationClass)
- Parameters:
cons-annotationClass-- Returns:
- The annotation on the method. If not found, return the annotation on the declaring class. If not found, return null.
-
hasTestInstance
boolean hasTestInstance(Method method, int i)
- Returns:
- true if the ith parameter of the given method has the annotation @TestInstance.
-
findOptionalValues
String[] findOptionalValues(Method method)
- Returns:
- the @Optional values of this method's parameters (
nullif the parameter isn't optional)
-
findOptionalValues
String[] findOptionalValues(Constructor ctor)
- Returns:
- the @Optional values of this method's parameters (
nullif the parameter isn't optional)
-
-