it would enhance the performance of visitors, if they could signal the
ClassReader that they want to skip the rest of the current method/annotation/
field/class. This can be done by throwing an exception like
SkipMethodException/SkipAnnotationException/... within the visitor-method.
These skip-exceptions should subclass RuntimeException, so the visitor-
interfaces doesn't have to be changed.
class AnnotationCollector extends EmptyVisitor
public void visitAnnotation(String desc, boolean visible) {
// store the annotation somehow
}
public void visitCode() {
// no more annotations will come, so skip method
throw new SkipMethodException();
}
}