for (AnnotationInfo annotation : info.getAnnotations()) { List<Info> annotationInfos = getAnnotationInfos(annotation.getName()); annotationInfos.add(info);
public List<Constructor> findAnnotatedConstructors(Class<? extends Annotation> annotation) { classesNotLoaded.clear(); List<ClassInfo> seen = new ArrayList<ClassInfo>(); List<Constructor> constructors = new ArrayList<Constructor>(); List<Info> infos = getAnnotationInfos(annotation.getName()); for (Info info : infos) { if (info instanceof MethodInfo && info.getName().equals("<init>")) { MethodInfo methodInfo = (MethodInfo) info; ClassInfo classInfo = methodInfo.getDeclaringClass(); if (seen.contains(classInfo)) continue; seen.add(classInfo); try { Class clazz = classInfo.get(); for (Constructor constructor : clazz.getConstructors()) { if (constructor.isAnnotationPresent(annotation)) { constructors.add(constructor); } } } catch (ClassNotFoundException e) { classesNotLoaded.add(classInfo.getName()); } } } return constructors; }
for (AnnotationInfo annotation : info.getAnnotations()) { List<Info> annotationInfos = getAnnotationInfos(annotation.getName()); annotationInfos.add(info);
for (AnnotationInfo annotation : info.getAnnotations()) { List<Info> annotationInfos = getAnnotationInfos(annotation.getName()); annotationInfos.add(info);
public List<Method> findAnnotatedMethods(Class<? extends Annotation> annotation) { classesNotLoaded.clear(); List<ClassInfo> seen = new ArrayList<ClassInfo>(); List<Method> methods = new ArrayList<Method>(); List<Info> infos = getAnnotationInfos(annotation.getName()); for (Info info : infos) { if (info instanceof MethodInfo && !info.getName().equals("<init>")) { MethodInfo methodInfo = (MethodInfo) info; ClassInfo classInfo = methodInfo.getDeclaringClass(); if (seen.contains(classInfo)) continue; seen.add(classInfo); try { Class clazz = classInfo.get(); for (Method method : clazz.getDeclaredMethods()) { if (method.isAnnotationPresent(annotation)) { methods.add(method); } } } catch (ClassNotFoundException e) { classesNotLoaded.add(classInfo.getName()); } } } return methods; }
public List<Method> findAnnotatedMethods(Class<? extends Annotation> annotation) { classesNotLoaded.clear(); List<ClassInfo> seen = new ArrayList<ClassInfo>(); List<Method> methods = new ArrayList<Method>(); List<Info> infos = getAnnotationInfos(annotation.getName()); for (Info info : infos) { if (info instanceof MethodInfo && !info.getName().equals("<init>")) { MethodInfo methodInfo = (MethodInfo) info; ClassInfo classInfo = methodInfo.getDeclaringClass(); if (seen.contains(classInfo)) continue; seen.add(classInfo); try { Class clazz = classInfo.get(); for (Method method : clazz.getDeclaredMethods()) { if (method.isAnnotationPresent(annotation)) { methods.add(method); } } } catch (ClassNotFoundException e) { classesNotLoaded.add(classInfo.getName()); } } } return methods; }
public List<Constructor> findAnnotatedConstructors(Class<? extends Annotation> annotation) { classesNotLoaded.clear(); List<ClassInfo> seen = new ArrayList<ClassInfo>(); List<Constructor> constructors = new ArrayList<Constructor>(); List<Info> infos = getAnnotationInfos(annotation.getName()); for (Info info : infos) { if (info instanceof MethodInfo && info.getName().equals("<init>")) { MethodInfo methodInfo = (MethodInfo) info; ClassInfo classInfo = methodInfo.getDeclaringClass(); if (seen.contains(classInfo)) continue; seen.add(classInfo); try { Class clazz = classInfo.get(); for (Constructor constructor : clazz.getConstructors()) { if (constructor.isAnnotationPresent(annotation)) { constructors.add(constructor); } } } catch (ClassNotFoundException e) { classesNotLoaded.add(classInfo.getName()); } } } return constructors; }
public List<Method> findAnnotatedMethods(Class<? extends Annotation> annotation) { classesNotLoaded.clear(); List<ClassInfo> seen = new ArrayList<ClassInfo>(); List<Method> methods = new ArrayList<Method>(); List<Info> infos = getAnnotationInfos(annotation.getName()); for (Info info : infos) { if (info instanceof MethodInfo && !info.getName().equals("<init>")) { MethodInfo methodInfo = (MethodInfo) info; ClassInfo classInfo = methodInfo.getDeclaringClass(); if (seen.contains(classInfo)) continue; seen.add(classInfo); try { Class clazz = classInfo.get(); for (Method method : clazz.getDeclaredMethods()) { if (method.isAnnotationPresent(annotation)) { methods.add(method); } } } catch (ClassNotFoundException e) { classesNotLoaded.add(classInfo.getName()); } } } return methods; }
public List<Constructor> findAnnotatedConstructors(Class<? extends Annotation> annotation) { classesNotLoaded.clear(); List<ClassInfo> seen = new ArrayList<ClassInfo>(); List<Constructor> constructors = new ArrayList<Constructor>(); List<Info> infos = getAnnotationInfos(annotation.getName()); for (Info info : infos) { if (info instanceof MethodInfo && info.getName().equals("<init>")) { MethodInfo methodInfo = (MethodInfo) info; ClassInfo classInfo = methodInfo.getDeclaringClass(); if (seen.contains(classInfo)) continue; seen.add(classInfo); try { Class clazz = classInfo.get(); for (Constructor constructor : clazz.getConstructors()) { if (constructor.isAnnotationPresent(annotation)) { constructors.add(constructor); } } } catch (ClassNotFoundException e) { classesNotLoaded.add(classInfo.getName()); } } } return constructors; }
@Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { AnnotationInfo annotationInfo = new AnnotationInfo(desc); info.getAnnotations().add(annotationInfo); getAnnotationInfos(annotationInfo.getName()).add(info); return new InfoBuildingVisitor(annotationInfo); }
@Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { AnnotationInfo annotationInfo = new AnnotationInfo(desc); info.getAnnotations().add(annotationInfo); getAnnotationInfos(annotationInfo.getName()).add(info); return new InfoBuildingVisitor(annotationInfo).annotationVisitor(); }
@Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { AnnotationInfo annotationInfo = new AnnotationInfo(desc); info.getAnnotations().add(annotationInfo); getAnnotationInfos(annotationInfo.getName()).add(info); return new InfoBuildingVisitor(annotationInfo).annotationVisitor(); }