AnnotationVisitor (String desc, boolean visible) { boolean matches = myPatternAnnotationClassName.equals(Type.getType(desc).getClassName()); return !matches ? null : new AnnotationVisitor(Opcodes.API_VERSION) { @Override public void visit(String name, Object value) { if ("value".equals(name) && value instanceof String) { myAnnotationPatterns.put(annotationClassName, (String)value); } } }; }