Skip to content

Instantly share code, notes, and snippets.

@iammert
Created May 9, 2017 08:33
Show Gist options
  • Save iammert/4dc8dd95c52fa447c4e686896d848277 to your computer and use it in GitHub Desktop.
Save iammert/4dc8dd95c52fa447c4e686896d848277 to your computer and use it in GitHub Desktop.
find elements in process
for (Element element : roundEnvironment.getElementsAnnotatedWith(NewIntent.class)) {
if (element.getKind() != ElementKind.CLASS) {
messager.printMessage(Diagnostic.Kind.ERROR, "Can be applied to class.");
return true;
}
TypeElement typeElement = (TypeElement) element;
activitiesWithPackage.put(
typeElement.getSimpleName().toString(),
elements.getPackageOf(typeElement).getQualifiedName().toString());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment