if (isScanParameterAnnotations()) {
config[scanners++] = new MethodParameterScanner();
}
config[scanners++] = ClasspathScanner.class.getClassLoader();
config[scanners++] = Thread.currentThread().getContextClassLoader();
AnnotationReflector reflector = new AnnotationReflector(null, _urls, config);
final HashSet<String> classNames = new HashSet<String>();
if (isScanClassAnnotations()) {
classNames.addAll(reflector.getReflector().getStore().getTypesAnnotatedWith(annotationClass.getName()));
}
if (isScanFieldAnnotations()) {
Set<Field> fields = reflector.getReflector().getFieldsAnnotatedWith(annotationClass);
for (Field field : fields) {
classNames.add(field.getDeclaringClass().getName());
}
}
if (isScanMethodAnnotations()) {
Set<Method> methods = reflector.getReflector().getMethodsAnnotatedWith(annotationClass);
for (Method method : methods) {
classNames.add(method.getDeclaringClass().getName());
}
Set<Constructor> constructors = reflector.getReflector().getConstructorsAnnotatedWith(annotationClass);
for (Constructor constructor : constructors) {
classNames.add(constructor.getDeclaringClass().getName());
}
}
if (isScanParameterAnnotations()) {
Set<Method> paramMethods = reflector.getReflector().getMethodsWithAnyParamAnnotated(annotationClass);
for (Method method : paramMethods) {
classNames.add(method.getDeclaringClass().getName());
}
}
return AnnotationCache.create(getTimestamp(), annotationClass, classNames);