@Override public List<? extends Annotation<O>> getAnnotations() { List<Annotation<O>> annotations = new ArrayList<Annotation<O>>(); FieldSource<O> field = getField(); if (field != null) { List<AnnotationSource<O>> fieldAnnotations = field.getAnnotations(); annotations.addAll(fieldAnnotations); } MethodSource<O> accessor = getAccessor(); if (accessor != null) { List<AnnotationSource<O>> accessorAnnotations = accessor.getAnnotations(); annotations.addAll(accessorAnnotations); } MethodSource<O> mutator = getMutator(); if (mutator != null) { List<AnnotationSource<O>> mutatorAnnotations = mutator.getAnnotations(); annotations.addAll(mutatorAnnotations); } return annotations; }
@Override public List<? extends Annotation<O>> getAnnotations() { List<Annotation<O>> annotations = new ArrayList<Annotation<O>>(); FieldSource<O> field = getField(); if (field != null) { List<AnnotationSource<O>> fieldAnnotations = field.getAnnotations(); annotations.addAll(fieldAnnotations); } MethodSource<O> accessor = getAccessor(); if (accessor != null) { List<AnnotationSource<O>> accessorAnnotations = accessor.getAnnotations(); annotations.addAll(accessorAnnotations); } MethodSource<O> mutator = getMutator(); if (mutator != null) { List<AnnotationSource<O>> mutatorAnnotations = mutator.getAnnotations(); annotations.addAll(mutatorAnnotations); } return annotations; }
for (AnnotationSource annoSource : fieldSource.getAnnotations()) { visit(annoSource);
public void visit(FieldSource<? extends JavaSource> fieldSource) { Type fieldType = fieldSource.getType(); String fieldClassName; // the javadoc for Named.getName() is misleading: // the FieldSource.getName() (which is implemented by FieldImpl.getName()) // returns the (fully-qualified!) name of the field String fieldName = fieldSource.getName(); resParts.addPart(fieldName, PartType.FIELD); if (fieldType.isPrimitive()) { fieldClassName = fieldType.getName(); } else { fieldClassName = fieldType.getQualifiedName(); } addJavaResourceReference(fieldClassName); // Field annotations for (AnnotationSource annoSource : fieldSource.getAnnotations()) { visit(annoSource); } }
field.isFinal()); List<AnnotationSource<JavaClassSource>> annotations = field.getAnnotations(); if (annotations != null) { for (AnnotationSource annotation : annotations) {