@Override
                public boolean processFileBytes(String name, long lastModified, byte[] bytes) {
                  if (!name.endsWith(".class")) {
                    return true;
                  }

                  ByteArray ba = new ByteArray(bytes);
                  DirectClassFile cf = new DirectClassFile(ba, name, true);

                  cf.setAttributeFactory(StdAttributeFactory.THE_ONE);
                  AttributeList attributes = cf.getAttributes();
                  Attribute att;

                  String cfClassName = cf.getThisClass().getClassType().getClassName();

                  if (cfClassName.endsWith(PACKAGE_INFO)) {
                    att = attributes.findFirst(AttRuntimeInvisibleAnnotations.ATTRIBUTE_NAME);

                    for (; att != null; att = attributes.findNext(att)) {
                      BaseAnnotations ann = (BaseAnnotations) att;
                      visitPackageAnnotation(cf, ann);
                    }

                    att = attributes.findFirst(AttRuntimeVisibleAnnotations.ATTRIBUTE_NAME);

                    for (; att != null; att = attributes.findNext(att)) {
                      BaseAnnotations ann = (BaseAnnotations) att;
                      visitPackageAnnotation(cf, ann);
                    }
                  } else if (isMatchingInnerClass(cfClassName) || isMatchingPackage(cfClassName)) {
                    printMatch(cf);
                  } else {
                    att = attributes.findFirst(AttRuntimeInvisibleAnnotations.ATTRIBUTE_NAME);

                    for (; att != null; att = attributes.findNext(att)) {
                      BaseAnnotations ann = (BaseAnnotations) att;
                      visitClassAnnotation(cf, ann);
                    }

                    att = attributes.findFirst(AttRuntimeVisibleAnnotations.ATTRIBUTE_NAME);

                    for (; att != null; att = attributes.findNext(att)) {
                      BaseAnnotations ann = (BaseAnnotations) att;
                      visitClassAnnotation(cf, ann);
                    }
                  }

                  return true;
                }
Processes based on configuration specified in constructor.
android/android_framework/dex-maker/src/main/java/com/android/dx/command/annotool/AnnotationLister.java