Package org.testng.internal.annotations
Class JDK15AnnotationFinder
- java.lang.Object
-
- org.testng.internal.annotations.JDK15AnnotationFinder
-
- All Implemented Interfaces:
IAnnotationFinder
public class JDK15AnnotationFinder extends Object implements IAnnotationFinder
This class implements IAnnotationFinder with JDK5 annotations Created on Dec 20, 2005- Author:
- Cedric Beust
-
-
Constructor Summary
Constructors Constructor Description JDK15AnnotationFinder(IAnnotationTransformer transformer)
-
Method Summary
All Methods Instance Methods Concrete 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 tm, Class<A> annotationClass)
String[]
findOptionalValues(Constructor method)
String[]
findOptionalValues(Method method)
boolean
hasTestInstance(Method method, int i)
-
-
-
Constructor Detail
-
JDK15AnnotationFinder
public JDK15AnnotationFinder(IAnnotationTransformer transformer)
-
-
Method Detail
-
findAnnotation
public <A extends IAnnotation> A findAnnotation(Method m, Class<A> annotationClass)
- Specified by:
findAnnotation
in interfaceIAnnotationFinder
- Returns:
- The annotation on the method. If not found, return the annotation on the declaring class. If not found, return null.
-
findAnnotation
public <A extends IAnnotation> A findAnnotation(ITestNGMethod tm, Class<A> annotationClass)
- Specified by:
findAnnotation
in interfaceIAnnotationFinder
-
findAnnotation
public <A extends IAnnotation> A findAnnotation(ConstructorOrMethod com, Class<A> annotationClass)
- Specified by:
findAnnotation
in interfaceIAnnotationFinder
-
findAnnotation
public <A extends IAnnotation> A findAnnotation(Class<?> cls, Class<A> annotationClass)
- Specified by:
findAnnotation
in interfaceIAnnotationFinder
- Returns:
- The annotation on the class or null if none found.
-
findAnnotation
public <A extends IAnnotation> A findAnnotation(Constructor<?> cons, Class<A> annotationClass)
- Specified by:
findAnnotation
in interfaceIAnnotationFinder
- Returns:
- The annotation on the method. If not found, return the annotation on the declaring class. If not found, return null.
-
hasTestInstance
public boolean hasTestInstance(Method method, int i)
- Specified by:
hasTestInstance
in interfaceIAnnotationFinder
- Returns:
- true if the ith parameter of the given method has the annotation @TestInstance.
-
findOptionalValues
public String[] findOptionalValues(Method method)
- Specified by:
findOptionalValues
in interfaceIAnnotationFinder
- Returns:
- the @Optional values of this method's parameters (
null
if the parameter isn't optional)
-
findOptionalValues
public String[] findOptionalValues(Constructor method)
- Specified by:
findOptionalValues
in interfaceIAnnotationFinder
- Returns:
- the @Optional values of this method's parameters (
null
if the parameter isn't optional)
-
-