// ------------------------------------------------------ collect methods
private void collectData(final RoundEnvironment roundEnv) throws Exception {
final Messager messager = processingEnv.getMessager();
final Types typeUtils = processingEnv.getTypeUtils();
final Elements elementUtils = processingEnv.getElementUtils();
for (Element e : roundEnv.getElementsAnnotatedWith(Store.class)) {
TypeElement storeElement = (TypeElement) e;
PackageElement packageElement = (PackageElement) storeElement.getEnclosingElement();
final String packageName = packageElement.getQualifiedName().toString();
final String storeDelegate = storeElement.getSimpleName().toString();
final boolean changeSupport = typeUtils.isAssignable(storeElement.asType(),
elementUtils.getTypeElement(ChangeSupport.class.getName()).asType());
final String storeClassName = GenerationUtil.storeImplementation(storeDelegate);
messager.printMessage(NOTE,
String.format("Discovered annotated store [%s]", storeElement.getQualifiedName()));
List<ExecutableElement> processMethods = new ArrayList<>();
if (findValidProcessMethods(messager, typeUtils, storeElement, processMethods)) {
Collection<ProcessInfo> processInfos = createProcessInfos(messager, typeUtils, elementUtils,
storeElement, processMethods);
metadata.add(new StoreDelegateMetadata(packageName, storeClassName, storeDelegate, changeSupport,
processInfos));
} else {
// no valid process methods!
messager.printMessage(ERROR,
String.format("%s does not contain suitable methods annotated with %s.",
storeElement.getQualifiedName(), Process.class.getName()));
break;
}
}