{
actualPayload = dmr;
}
else if(ModelType.PROPERTY.equals(dmr.getType()))
{
final Property property = dmr.asProperty();
keyDelegation = new KeyAssignment() {
@Override
public Object valueForKey(String key) {
Object resolvedValue = null;
// use delegate
if(keyAssignment!=null)
resolvedValue = keyAssignment.valueForKey(key);
// if delegate fails, fallback to property name
if(null==resolvedValue)
resolvedValue = property.getName();
return resolvedValue;
}
};
actualPayload = property.getValue();
}
else
{
throw new IllegalArgumentException("Unknown ModelType "+dmr.getType()+": "+dmr);
}