throw new CouchJsonException(e);
}
}
protected CustomInjectableValues buildInjectableValues(GetRequestFactory getRequestFactory, EntityMeta<?> entityMeta, String documentId, String revision) {
CustomInjectableValues inject = CustomInjectableValues.newThrowExceptionOnMissing();
// TODO - injectables should only be used if the class has any @JsonInjectable annotations
// 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;
}