publicboolean process(Set<? extends TypeElement> annoElems,
RoundEnvironment renv) {
Trees trees = Trees.instance(processingEnv); for (TypeElement annoElem: annoElems) { for (Element te: renv.getRootElements()) {
System.err.println("te: " + te); for (AnnotationMirror anno: te.getAnnotationMirrors()) { // anno is an annotation on te, not on annoElem, // so we expect the following to return null // (and not give NPE)
checkNull(trees.getPath(annoElem, anno));
checkNull(trees.getTree(annoElem, anno));
}
}
} returntrue;
}
@Override public SourceVersion getSupportedSourceVersion() { return SourceVersion.latest();
}
publicvoid checkNull(Object o) { if (o != null) thrownew AssertionError("expected null");
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.