throw new ObjectMappingException("Only 'header' and 'body' can contain hierarchical names: " + expression) ;
}
String location = path[0];
String name = path[1];
if ("body".equalsIgnoreCase(location)) {
Body body = message.getBody();
if (path.length == 2) {
if (BODY_CONTENT.equals(name)) {
try {
payloadProxy.setPayload(message, object);
} catch (MessageDeliverException e) {
throw new ObjectMappingException("Unable to set payload on message.", e) ;
}
} else {
body.add(name, object);
}
} else {
final Object bodyObject ;
if (BODY_CONTENT.equals(name)) {
try {
bodyObject = payloadProxy.getPayload(message) ;
} catch (final MessageDeliverException mde) {
throw new ObjectMappingException("Unable to get payload from message.", mde) ;
}
} else {
bodyObject = body.get(name) ;
}
if (bodyObject == null) {
throw new ObjectMappingException("Unable to set property on named object: " + name + ", object does not exist in message") ;
}