1 package org.testng; 2 3 import org.testng.annotations.ITestAnnotation; 4 5 import java.lang.reflect.Constructor; 6 import java.lang.reflect.Method; 7 8 public interface IAnnotationTransformer extends ITestNGListener { 9 10 /** 11 * This method will be invoked by TestNG to give you a chance 12 * to modify a TestNG annotation read from your test classes. 13 * You can change the values you need by calling any of the 14 * setters on the ITest interface. 15 * 16 * Note that only one of the three parameters testClass, 17 * testConstructor and testMethod will be non-null. 18 * 19 * @param annotation The annotation that was read from your 20 * test class. 21 * @param testClass If the annotation was found on a class, this 22 * parameter represents this class (null otherwise). 23 * @param testConstructor If the annotation was found on a constructor, 24 * this parameter represents this constructor (null otherwise). 25 * @param testMethod If the annotation was found on a method, 26 * this parameter represents this method (null otherwise). 27 */ transform(ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod)28 public void transform(ITestAnnotation annotation, Class testClass, 29 Constructor testConstructor, Method testMethod); 30 31 } 32