ClassInfo classInfo = fieldInfo.getDeclaringClass(); fields.add((Field) fieldInfo.get()); } catch (ClassNotFoundException e) { classesNotLoaded.add(fieldInfo.getDeclaringClass().getName());
final FieldInfo fieldInfo = new FieldInfo(classInfo, field); if (linking) { classInfo.fields.add(fieldInfo);
fieldAnnotations.forEach((k, v) -> { try { if (k.get().equals(fld.getTarget())) { fld.addAnnotations(v);
final FieldInfo fieldInfo = new FieldInfo(classInfo, field); if (linking) { classInfo.fields.add(fieldInfo);
ClassInfo classInfo = fieldInfo.getDeclaringClass();
ClassInfo classInfo = fieldInfo.getDeclaringClass();
ClassInfo classInfo = fieldInfo.getDeclaringClass();
ClassInfo classInfo = fieldInfo.getDeclaringClass(); fields.add((Field) fieldInfo.get()); } catch (ClassNotFoundException e) { classesNotLoaded.add(fieldInfo.getDeclaringClass().getName());
infos.add(new FieldInfo(classInfo, field));
public List<Field> findAnnotatedFields(Class<? extends Annotation> annotation) { classesNotLoaded.clear(); List<ClassInfo> seen = new ArrayList<ClassInfo>(); List<Field> fields = new ArrayList<Field>(); List<Info> infos = getAnnotationInfos(annotation.getName()); for (Info info : infos) { if (info instanceof FieldInfo) { FieldInfo fieldInfo = (FieldInfo) info; ClassInfo classInfo = fieldInfo.getDeclaringClass(); if (seen.contains(classInfo)) continue; seen.add(classInfo); try { Class clazz = classInfo.get(); for (Field field : clazz.getDeclaredFields()) { if (field.isAnnotationPresent(annotation)) { fields.add(field); } } } catch (ClassNotFoundException e) { classesNotLoaded.add(classInfo.getName()); } } } return fields; }
public List<Annotated<Field>> findAnnotatedFields(final Class<? extends Annotation> annotation) { Finder.this.findAnnotatedFields(annotation); return typed(FieldInfo.class, getAnnotationInfos(annotation.getName())::stream).map(fieldInfo -> { try { return new IncludesClassfile<>((Field) fieldInfo.get(), classfileAnnotationsFor(fieldInfo)); } catch (final ClassNotFoundException e) { return null; } }).filter(hasAnnotation(annotation)).collect(Collectors.toList()); }
@Override public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { ClassInfo classInfo = ((ClassInfo) info); FieldInfo fieldInfo = new FieldInfo(classInfo, name, desc); classInfo.getFields().add(fieldInfo); return new InfoBuildingVisitor(fieldInfo); }
public Member get() throws ClassNotFoundException { if (field == null) { field = toField(); } return field; }
@Override public Annotation[] getDeclaredAnnotations() { super.getDeclaredAnnotations(); try { return ((AnnotatedElement) get()).getDeclaredAnnotations(); } catch (ClassNotFoundException e) { return super.getDeclaredAnnotations(); } }
public Member get() throws ClassNotFoundException { if (field == null) { field = toField(); } return field; }
@Override public Annotation[] getDeclaredAnnotations() { super.getDeclaredAnnotations(); try { return ((AnnotatedElement) get()).getDeclaredAnnotations(); } catch (ClassNotFoundException e) { return super.getDeclaredAnnotations(); } }
public Member get() throws ClassNotFoundException { if (field == null) { field = toField(); } return field; }
@Override public Annotation[] getDeclaredAnnotations() { super.getDeclaredAnnotations(); try { return ((AnnotatedElement) get()).getDeclaredAnnotations(); } catch (ClassNotFoundException e) { return super.getDeclaredAnnotations(); } }
@Override public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { ClassInfo classInfo = ((ClassInfo) info); FieldInfo fieldInfo = new FieldInfo(classInfo, name, desc); classInfo.getFields().add(fieldInfo); return new InfoBuildingVisitor(fieldInfo).fieldVisitor(); }