class DocumentFieldValueMarshaller extends AbstractFieldValueMarshaller<Document, DocumentData, DocumentFieldDefinition> {

    @Override
    public DocumentData toFlatValue() {

        if (originalValue == null) {
            return null;
        }

        String templateId = (String) context.getAttributes().get(SERVER_TEMPLATE_ID);

        return fromDocument(originalValue, templateId);
    }

    @Inject public  DocumentFieldValueMarshaller(UploadedDocumentStorage documentStorage);

}