1 package org.testng; 2 3 import org.testng.annotations.IConfigurationAnnotation; 4 import org.testng.annotations.IDataProviderAnnotation; 5 import org.testng.annotations.IFactoryAnnotation; 6 7 import java.lang.reflect.Constructor; 8 import java.lang.reflect.Method; 9 10 /** 11 * Use this interface instead of IAnnotationTransformer if you want to modify any TestNG 12 * annotation besides @Test. 13 */ 14 public interface IAnnotationTransformer2 extends IAnnotationTransformer { 15 /** 16 * Transform an IConfiguration annotation. 17 * 18 * Note that only one of the three parameters testClass, 19 * testConstructor and testMethod will be non-null. 20 * 21 * @param annotation The annotation that was read from your 22 * test class. 23 * @param testClass If the annotation was found on a class, this 24 * parameter represents this class (null otherwise). 25 * @param testConstructor If the annotation was found on a constructor, 26 * this parameter represents this constructor (null otherwise). 27 * @param testMethod If the annotation was found on a method, 28 * this parameter represents this method (null otherwise). 29 */ transform(IConfigurationAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod)30 public void transform(IConfigurationAnnotation annotation, Class testClass, 31 Constructor testConstructor, Method testMethod); 32 33 /** 34 * Transform an IDataProvider annotation. 35 * 36 * @param method The method annotated with the IDataProvider annotation. 37 */ transform(IDataProviderAnnotation annotation, Method method)38 public void transform(IDataProviderAnnotation annotation, Method method); 39 40 /** 41 * Transform an IFactory annotation. 42 * 43 * @param method The method annotated with the IFactory annotation. 44 */ transform(IFactoryAnnotation annotation, Method method)45 public void transform(IFactoryAnnotation annotation, Method method); 46 } 47