for (ReferenceBinding referenceBinding : referenceBindings) {
// collect all annotations from the binary types
AnnotationBinding[] annotationBindings = referenceBinding.getAnnotations();
for (AnnotationBinding annotationBinding : annotationBindings) {
TypeElement anno = (TypeElement)_factory.newElement(annotationBinding.getAnnotationType());
Element element = _factory.newElement(referenceBinding);
_annoToUnit.put(anno, element);
}
FieldBinding[] fieldBindings = referenceBinding.fields();
for (FieldBinding fieldBinding : fieldBindings) {
annotationBindings = fieldBinding.getAnnotations();
for (AnnotationBinding annotationBinding : annotationBindings) {
TypeElement anno = (TypeElement)_factory.newElement(annotationBinding.getAnnotationType());
Element element = _factory.newElement(fieldBinding);
_annoToUnit.put(anno, element);
}
}
MethodBinding[] methodBindings = referenceBinding.methods();
for (MethodBinding methodBinding : methodBindings) {
annotationBindings = methodBinding.getAnnotations();
for (AnnotationBinding annotationBinding : annotationBindings) {
TypeElement anno = (TypeElement)_factory.newElement(annotationBinding.getAnnotationType());
Element element = _factory.newElement(methodBinding);
_annoToUnit.put(anno, element);
}
}
ReferenceBinding[] memberTypes = referenceBinding.memberTypes();
collectAnnotations(memberTypes);