throw new CouchJsonException(e);
}
}
protected CustomJacksonInjectableValues buildInjectableValues(GetRequestFactory getRequestFactory, EntityMeta<?> entityMeta, String documentId, String revision) {
CustomJacksonInjectableValues inject = new CustomJacksonInjectableValues(missingInjectableResponse, couchInjectables);
// TODO - couchInjectables should only be used if the class has any @JsonInjectable annotations
// Add id if it's defined
if (entityMeta.hasId() && documentId != null) {
inject.addValue(entityMeta.getIdName(), documentId);
}
// Add revision if it's defined
if (entityMeta.hasRevision() && revision != null) {
inject.addValue(entityMeta.getRevisionName(), revision);
}
// Add any attachments
if (entityMeta.hasAttachments()) {
for (AttachmentMeta attachmentDef : entityMeta.getAttachmentMetaList()) {
GetAttachmentResponse response = getRequestFactory.attachment(documentId, revision, attachmentDef.getAttachmentName()).execute();
inject.addValue(attachmentDef.getAttachmentName(), response.getContent());
}
}
return inject;
}