List<InheritedAttribute> isList = Algorithms.flatten( iaClasses,
new UnaryFunction<EvaluatedClassDeclaration,List<InheritedAttribute>>() {
public List<InheritedAttribute> evaluate( EvaluatedClassDeclaration cls ) {
final InheritedAttribute ia = getFirstAnnotationOnClass(cls,
InheritedAttribute.class);
final InheritedAttributes ias = getFirstAnnotationOnClass(cls,
InheritedAttributes.class);
if ((ia != null) && (ias != null)) {
throw Exceptions.self.badInheritedAttributeAnnotation(cls) ;
}
final List<InheritedAttribute> result =
new ArrayList<InheritedAttribute>() ;
if (ia != null) {
result.add( ia ) ;
} else if (ias != null) {
result.addAll( Arrays.asList( ias.value() )) ;
}
return result ;
}
} ) ;