Skip to content

Instantly share code, notes, and snippets.

@davidtimmerman
Last active August 29, 2015 14:04
Show Gist options
  • Save davidtimmerman/106f7244e3fa0bbed517 to your computer and use it in GitHub Desktop.
Save davidtimmerman/106f7244e3fa0bbed517 to your computer and use it in GitHub Desktop.
@SupportedAnnotationTypes("me.guice.annotations.PropertySource")
@SupportedSourceVersion(SourceVersion.RELEASE_8)
public class PropertySourceProcessor extends AbstractProcessor {
public PropertySourceProcessor() {
super();
}
@Override
public boolean process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv) {
for (Element elem : roundEnv.getElementsAnnotatedWith(PropertySource.class)) {
PropertySource prop = elem.getAnnotation(PropertySource.class);
String message = "wants a " + elem.getSimpleName()
+ " from file " + prop.file();
processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, message);
}
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment