Class JDK15AnnotationFinder
java.lang.Object
org.testng.internal.annotations.JDK15AnnotationFinder
- All Implemented Interfaces:
IAnnotationFinder
This class implements IAnnotationFinder with JDK5 annotations
-
Constructor Summary
Constructors -
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 tm, Class<A> annotationClass) <A extends IAnnotation>
List<A> findInheritedAnnotations(Class<?> cls, Class<A> annotationClass) String[]findOptionalValues(Constructor<?> method) String[]findOptionalValues(Method method) booleanhasTestInstance(Method method, int i)
-
Constructor Details
-
JDK15AnnotationFinder
-
-
Method Details
-
findAnnotation
- Specified by:
findAnnotationin interfaceIAnnotationFinder- Type Parameters:
A- The expectedIAnnotationtype- Parameters:
m- - The correspondingMethodannotationClass- - 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
- Specified by:
findAnnotationin interfaceIAnnotationFinder
-
findAnnotation
- Specified by:
findAnnotationin interfaceIAnnotationFinder
-
findAnnotation
- Specified by:
findAnnotationin interfaceIAnnotationFinder
-
findAnnotation
- Specified by:
findAnnotationin interfaceIAnnotationFinder- Type Parameters:
A- The expectedIAnnotationtype- 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
- Specified by:
findAnnotationin interfaceIAnnotationFinder- Type Parameters:
A- The expectedIAnnotationtype- Parameters:
cons- - The correspondingConstructorannotationClass- - 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
public <A extends IAnnotation> List<A> findInheritedAnnotations(Class<?> cls, Class<A> annotationClass) - Specified by:
findInheritedAnnotationsin interfaceIAnnotationFinder- Type Parameters:
A- - The expectedIAnnotationtype- 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
- Specified by:
hasTestInstancein interfaceIAnnotationFinder- Parameters:
method- TheMethodi- The parameter index- Returns:
- true if the ith parameter of the given method has the annotation @TestInstance.
-
findOptionalValues
- Specified by:
findOptionalValuesin interfaceIAnnotationFinder- Parameters:
method- TheMethod- Returns:
- the @Optional values of this method's parameters (
nullif the parameter isn't optional)
-
findOptionalValues
- Specified by:
findOptionalValuesin interfaceIAnnotationFinder- Parameters:
method- TheConstructor- Returns:
- the @Optional values of this method's parameters (
nullif the parameter isn't optional)
-