final List<InheritedAttribute> ias = getInheritedAttributes( ca ) ;
ca.findFields( new Predicate<EvaluatedFieldDeclaration>() {
public boolean evaluate( EvaluatedFieldDeclaration field ) {
ManagedAttribute ma = getAnnotation( field.element(),
ManagedAttribute.class ) ;
if (ma == null) {
return false ;
} else {
checkFieldType( field ) ;
Description desc = getAnnotation( field.element(),
Description.class ) ;
String description ;
if (desc == null) {
description = "No description available for "
+ field.name() ;
} else {
description = desc.value() ;
}
AttributeDescriptor ad =
AttributeDescriptor.makeFromAnnotated(
ManagedObjectManagerImpl.this, field,
ma.id(), description, adt ) ;
putIfNotPresent( getters, ad.id(), ad ) ;
return true ;
}
} } ) ;
ca.findMethods( new Predicate<EvaluatedMethodDeclaration>() {
public boolean evaluate( EvaluatedMethodDeclaration method ) {
ManagedAttribute ma = getAnnotation( method.element(),
ManagedAttribute.class ) ;
AttributeDescriptor ad ;
if (ma == null) {
ad = getAttributeDescriptorIfInherited( method, ias,
adt ) ;
} else {
Description desc = getAnnotation( method.element(),
Description.class ) ;
String description ;
if (desc == null) {
description = "No description available for "
+ method.name() ;
} else {
description = desc.value() ;
}
ad = AttributeDescriptor.makeFromAnnotated(
ManagedObjectManagerImpl.this,
method, ma.id(), description, adt ) ;
}
if (ad != null) {
if (ad.atype()==AttributeDescriptor.AttributeType.GETTER) {
putIfNotPresent( getters, ad.id(), ad ) ;