1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.openehealth.ipf.commons.ihe.xds.core.metadata;
17
18 import lombok.EqualsAndHashCode;
19 import lombok.ToString;
20 import org.openehealth.ipf.commons.core.ContentMap;
21
22 import javax.activation.DataHandler;
23 import javax.xml.bind.annotation.XmlAccessType;
24 import javax.xml.bind.annotation.XmlAccessorType;
25 import javax.xml.bind.annotation.XmlElement;
26 import javax.xml.bind.annotation.XmlMimeType;
27 import javax.xml.bind.annotation.XmlRootElement;
28 import javax.xml.bind.annotation.XmlType;
29 import java.io.Serializable;
30
31
32
33
34
35
36
37
38
39 @XmlAccessorType(XmlAccessType.FIELD)
40 @XmlType(name = "Document")
41 @XmlRootElement(name = "document")
42 @EqualsAndHashCode(callSuper = false, doNotUseGetters = true)
43 @ToString(doNotUseGetters = true)
44 public class Document extends ContentMap implements Serializable {
45 private static final long serialVersionUID = 5206884085835642756L;
46
47 private DocumentEntry documentEntry;
48
49 public Document() {
50 }
51
52
53
54
55
56
57
58
59 public Document(DocumentEntry documentEntry, DataHandler dataHandler) {
60 this.documentEntry = documentEntry;
61 if (dataHandler != null) {
62 setContent(DataHandler.class, dataHandler);
63 }
64 }
65
66
67
68
69 public DocumentEntry getDocumentEntry() {
70 return documentEntry;
71 }
72
73
74
75
76
77 public void setDocumentEntry(DocumentEntry documentEntry) {
78 this.documentEntry = documentEntry;
79 }
80
81
82
83
84
85
86 @XmlElement(name = "data")
87 @XmlMimeType("application/octet-stream")
88 public DataHandler getDataHandler() {
89 return getContent(DataHandler.class);
90 }
91
92
93
94
95
96
97
98 public void setDataHandler(DataHandler dataHandler) {
99 setContent(DataHandler.class, dataHandler);
100 }
101
102 }