* Embedded objects are never referred to by uuid in the payload, so an instance will need
* to be allocated before reading in the properties.
*/
@SuppressWarnings("unchecked")
EntityCodex<HasUuid> codex = (EntityCodex<HasUuid>) prop.getCodex();
HasUuid embedded = codex.allocateEmbedded(payload, context);
value = ctx.walkImmutable(codex).accept(this, embedded);
} else {
@SuppressWarnings("unchecked")
Codex<Object> codex = (Codex<Object>) prop.getCodex();
// merchant would become merchantUuid
String payloadPropertyName = simplePropertyName + codex.getPropertySuffix();
// Ignore undefined property values, while allowing explicit nullification
if (!payload.has(payloadPropertyName)) {
return;
}
value = codex.read(payload.get(payloadPropertyName), context);
}
if (value == null && prop.getSetter().getParameterTypes()[0].isPrimitive()) {
// Don't try to pass a null to a primitive setter
return;
}
HasUuid entity = stack.peek().entity;
// Verify the new value may be set
if (!checkAccess(entity, prop, value, context)) {
return;
}