1 package net.florianschoppmann.java.type; 2 3 import javax.lang.model.element.TypeElement; 4 import java.util.Map; 5 6 /** 7 * Provider for {@link AbstractTypes} instances in contract tests. 8 */ 9 public interface AbstractTypesProvider { 10 /** 11 * Performs pre-contract actions. 12 * 13 * <p>This method is called from within an {@link org.testng.annotations.BeforeClass} annotated method. It is 14 * therefore possible to throw a {@link org.testng.SkipException} in this method. 15 */ 16 void preContract(); 17 18 /** 19 * Puts {@link TypeElement} instances into the given map (corresponding to the {@link Class} keys) and returns a 20 * {@link AbstractTypes} instance. 21 * 22 * <p>Implementations of this method must put a {@link TypeElement} instance for each {@link Class} key into the 23 * given map. Implementations must not add or remove entries to/from the given map. 24 * 25 * @param classTypeElementMap Map with {@link Class} objects as keys. The value for each key is initially undefined 26 * and must be updated with the respective {@link TypeElement} upon return. 27 * @return the {@link AbstractTypes} instance that will be used for the contract test 28 */ 29 AbstractTypes getTypes(Map<Class<?>, TypeElement> classTypeElementMap); 30 }