Last active
February 5, 2017 02:08
-
-
Save igor-brishkoski/0d05159e7e12464a27dafb62f1d355d7 to your computer and use it in GitHub Desktop.
Filter Elements Guava
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean process(Set<? extends TypeElement> set, RoundEnvironment roundEnvironment) { | |
//get all elements annotated with AwesomeLogger | |
Collection<? extends Element> annotatedElements = roundEnvironment.getElementsAnnotatedWith(AwesomeLogger.class); | |
//filter out elements we don't need | |
List<TypeElement> types = new ImmutableList.Builder<TypeElement>() | |
.addAll(ElementFilter.typesIn(annotatedElements)) | |
.build(); | |
for (TypeElement type : types) { | |
... | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment