import java.util.*;
import java.io.*;
+import java.nio.file.*;
import javax.annotation.processing.*;
import javax.tools.*;
import javax.lang.model.*;
import javax.lang.model.util.*;
@SupportedAnnotationTypes({"*"})
-@SupportedSourceVersion(SourceVersion.RELEASE_5)
public class Collector extends AbstractProcessor {
private ProcessingEnvironment cfg;
private Elements eu;
+ private boolean verbose = false;
public void init(ProcessingEnvironment cfg) {
this.cfg = cfg;
InputStream in;
try {
in = lf.openInputStream();
- } catch(FileNotFoundException e) {
+ } catch(FileNotFoundException | NoSuchFileException e) {
return(prev);
}
try {
}
TypeElement type = (TypeElement)e;
String nm = tn(type);
- if(!prev.contains(nm))
+ if(!prev.contains(nm) && verbose)
cfg.getMessager().printMessage(Diagnostic.Kind.NOTE, "added " + nm, type);
found.add(nm);
carry.remove(nm);
TypeElement el = types.get(nm);
if(el != null) {
i.remove();
- cfg.getMessager().printMessage(Diagnostic.Kind.NOTE, "removed " + nm, el);
+ if(verbose)
+ cfg.getMessager().printMessage(Diagnostic.Kind.NOTE, "removed " + nm, el);
}
}
List<String> all = new ArrayList<String>();
}
return(false);
}
+
+ public SourceVersion getSupportedSourceVersion() {
+ return(SourceVersion.latest());
+ }
}