use of org.qi4j.api.association.Association in project qi4j-sdk by Qi4j.
the class Qi4jPropertyAccessor method getProperty.
@Override
public final Object getProperty(Map aContext, Object aTarget, Object aPropertyName) throws OgnlException {
String fieldName = aPropertyName.toString();
Object qi4jField = getQi4jField(aContext, aTarget, fieldName);
if (qi4jField != null) {
Class memberClass = qi4jField.getClass();
if (Property.class.isAssignableFrom(memberClass)) {
Property property = (Property) qi4jField;
return property.get();
} else if (Association.class.isAssignableFrom(memberClass)) {
Association association = (Association) qi4jField;
return association.get();
} else if (ManyAssociation.class.isAssignableFrom(memberClass)) {
return qi4jField;
}
}
return super.getProperty(aContext, aTarget, fieldName);
}
Aggregations