Top Description Fields Constructors Methods
org.testng.internal.annotations

public Class JDK15AnnotationFinder

extends Object
implements IAnnotationFinder
Class Inheritance
All Implemented Interfaces
org.testng.internal.annotations.IAnnotationFinder
Imports
java.lang.annotation.Annotation, java.lang.reflect.Constructor, .Method, java.util.ArrayList, .Collections, .List, .Map, .Objects, java.util.concurrent.ConcurrentHashMap, org.testng.IAnnotationTransformer, .ITestNGMethod, org.testng.annotations.AfterClass, .AfterGroups, .AfterMethod, .AfterSuite, .AfterTest, .BeforeClass, .BeforeGroups, .BeforeMethod, .BeforeSuite, .BeforeTest, .DataProvider, .Factory, .IAnnotation, .IConfigurationAnnotation, .IDataProviderAnnotation, .IFactoryAnnotation, .IIgnoreAnnotation, .IListenersAnnotation, .IObjectFactoryAnnotation, .IParametersAnnotation, .ITestAnnotation, .Ignore, .Listeners, .ObjectFactory, .Optional, .Parameters, .Test, .TestInstance, org.testng.internal.ConstructorOrMethod, org.testng.internal.collections.Pair

This class implements IAnnotationFinder with JDK5 annotations

Field Summary

Modifier and TypeField and Description
private final Map<Class<? extends IAnnotation>, Class<? extends Annotation>>
private final Map<String, IAnnotation>
private final JDK15TagFactory
private final IAnnotationTransformer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <A extends IAnnotation> A
findAnnotation(Method
- The corresponding Method
m
,
Class<A>
- The class on which annotation is to be looked for.
annotationClass
)

Implements org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

public <A extends IAnnotation> A
public <A extends IAnnotation> A
public <A extends IAnnotation> A
public <A extends IAnnotation> A
findAnnotation(Class<?>
- The corresponding class.
cls
,
Class<A>
- The class on which annotation is to be looked for.
annotationClass
)

Implements org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

public <A extends IAnnotation> A
findAnnotation(Constructor<?>
- The corresponding Constructor
cons
,
Class<A>
- The class on which annotation is to be looked for.
annotationClass
)

Implements org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

private <A extends IAnnotation> A
findAnnotation(Class<?> cls, Annotation a, Class<A> annotationClass, Class<?> testClass, Constructor<?> testConstructor, Method testMethod, Pair<Annotation, ?> p, Class<?> whichClass)

private <A extends Annotation> A
public <A extends IAnnotation> List<A>
findInheritedAnnotations(Class<?>
- The corresponding class.
cls
,
Class<A>
- The class on which annotation is to be looked for.
annotationClass
)

Implements org.testng.internal.annotations.IAnnotationFinder.findInheritedAnnotations.

public String[]
public String[]
private <A extends IAnnotation> void
findSuperInterface(Class<?> cls, Class<?> inter, Class<A> annotationClass, Class<? extends Annotation> a, List<A> annotations)

public boolean
hasTestInstance(Method
The Method
method
,
int
The parameter index
i
)

Implements org.testng.internal.annotations.IAnnotationFinder.hasTestInstance.

private String[]
optionalValues(Annotation[][] annotations)

private void
transform(IAnnotation a, Class<?> testClass, Constructor<?> testConstructor, Method testMethod, Class<?> whichClass)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

m_annotationMapback to summary
private final Map<Class<? extends IAnnotation>, Class<? extends Annotation>> m_annotationMap
m_annotationsback to summary
private final Map<String, IAnnotation> m_annotations
m_tagFactoryback to summary
private final JDK15TagFactory m_tagFactory
m_transformerback to summary
private final IAnnotationTransformer m_transformer

Constructor Detail

JDK15AnnotationFinderback to summary
public JDK15AnnotationFinder(IAnnotationTransformer transformer)

Method Detail

findAnnotationback to summary
public <A extends IAnnotation> A findAnnotation(Method m, Class<A> annotationClass)

Implements org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

Parameters
<A>

Doc from org.testng.internal.annotations.IAnnotationFinder.findAnnotation. The expected IAnnotation type

m:Method

Doc from org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

- The corresponding Method

annotationClass:Class<A>

Doc from org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

- The class on which annotation is to be looked for.

Returns:A

Doc from org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

The annotation on the method. If not found, return the annotation on the declaring class. If not found, return null.

Annotations
@Override
findAnnotationback to summary
public <A extends IAnnotation> A findAnnotation(Class<?> clazz, Method m, Class<A> annotationClass)

Implements org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

Annotations
@Override
findAnnotationback to summary
public <A extends IAnnotation> A findAnnotation(ITestNGMethod tm, Class<A> annotationClass)

Implements org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

Annotations
@Override
findAnnotationback to summary
public <A extends IAnnotation> A findAnnotation(ConstructorOrMethod com, Class<A> annotationClass)

Implements org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

Annotations
@Override
findAnnotationback to summary
public <A extends IAnnotation> A findAnnotation(Class<?> cls, Class<A> annotationClass)

Implements org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

Parameters
<A>

Doc from org.testng.internal.annotations.IAnnotationFinder.findAnnotation. The expected IAnnotation type

cls:Class<?>

Doc from org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

- The corresponding class.

annotationClass:Class<A>

Doc from org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

- The class on which annotation is to be looked for.

Returns:A

Doc from org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

The annotation on the class or null if none found.

Annotations
@Override
findAnnotationback to summary
public <A extends IAnnotation> A findAnnotation(Constructor<?> cons, Class<A> annotationClass)

Implements org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

Parameters
<A>

Doc from org.testng.internal.annotations.IAnnotationFinder.findAnnotation. The expected IAnnotation type

cons:Constructor<?>

Doc from org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

- The corresponding Constructor

annotationClass:Class<A>

Doc from org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

- The class on which annotation is to be looked for.

Returns:A

Doc from org.testng.internal.annotations.IAnnotationFinder.findAnnotation.

The annotation on the method. If not found, return the annotation on the declaring class. If not found, return null.

Annotations
@Override
findAnnotationback to summary
private <A extends IAnnotation> A findAnnotation(Class<?> cls, Annotation a, Class<A> annotationClass, Class<?> testClass, Constructor<?> testConstructor, Method testMethod, Pair<Annotation, ?> p, Class<?> whichClass)
findAnnotationInSuperClassesback to summary
private <A extends Annotation> A findAnnotationInSuperClasses(Class<?> cls, Class<A> a)
findInheritedAnnotationsback to summary
public <A extends IAnnotation> List<A> findInheritedAnnotations(Class<?> cls, Class<A> annotationClass)

Implements org.testng.internal.annotations.IAnnotationFinder.findInheritedAnnotations.

Parameters
<A>

Doc from org.testng.internal.annotations.IAnnotationFinder.findInheritedAnnotations. - The expected IAnnotation type

cls:Class<?>

Doc from org.testng.internal.annotations.IAnnotationFinder.findInheritedAnnotations.

- The corresponding class.

annotationClass:Class<A>

Doc from org.testng.internal.annotations.IAnnotationFinder.findInheritedAnnotations.

- The class on which annotation is to be looked for.

Returns:List<A>

Doc from org.testng.internal.annotations.IAnnotationFinder.findInheritedAnnotations.

The annotations on the inherited interfaces. If not found, return the annotations on the declaring interface. If not found, return an empty list.

Annotations
@Override
findOptionalValuesback to summary
public String[] findOptionalValues(Method method)

Implements org.testng.internal.annotations.IAnnotationFinder.findOptionalValues.

Parameters
method:Method

Doc from org.testng.internal.annotations.IAnnotationFinder.findOptionalValues.

The Method

Returns:String[]

Doc from org.testng.internal.annotations.IAnnotationFinder.findOptionalValues.

the @Optional values of this method's parameters (null if the parameter isn't optional)

Annotations
@Override
findOptionalValuesback to summary
public String[] findOptionalValues(Constructor<?> method)

Implements org.testng.internal.annotations.IAnnotationFinder.findOptionalValues.

Parameters
method:Constructor<?>

Doc from org.testng.internal.annotations.IAnnotationFinder.findOptionalValues.

The Constructor

Returns:String[]

Doc from org.testng.internal.annotations.IAnnotationFinder.findOptionalValues.

the @Optional values of this method's parameters (null if the parameter isn't optional)

Annotations
@Override
findSuperInterfaceback to summary
private <A extends IAnnotation> void findSuperInterface(Class<?> cls, Class<?> inter, Class<A> annotationClass, Class<? extends Annotation> a, List<A> annotations)
hasTestInstanceback to summary
public boolean hasTestInstance(Method method, int i)

Implements org.testng.internal.annotations.IAnnotationFinder.hasTestInstance.

Parameters
method:Method

Doc from org.testng.internal.annotations.IAnnotationFinder.hasTestInstance.

The Method

i:int

Doc from org.testng.internal.annotations.IAnnotationFinder.hasTestInstance.

The parameter index

Returns:boolean

Doc from org.testng.internal.annotations.IAnnotationFinder.hasTestInstance.

true if the ith parameter of the given method has the annotation @TestInstance.

Annotations
@Override
optionalValuesback to summary
private String[] optionalValues(Annotation[][] annotations)
transformback to summary
private void transform(IAnnotation a, Class<?> testClass, Constructor<?> testConstructor, Method testMethod, Class<?> whichClass)