Revision f1a25720
Added by Katja Luther over 6 years ago
- ID f1a25720755daa96e8838a617a660dfced7b9f31
- Parent 23e50194
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/dto/tdwg/BaseThing.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2007 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 | 9 |
package eu.etaxonomy.cdm.remote.dto.tdwg; |
10 | 10 |
|
11 | 11 |
import java.net.URI; |
12 |
import java.time.ZonedDateTime; |
|
12 | 13 |
import java.util.Set; |
13 | 14 |
|
14 | 15 |
import javax.xml.bind.annotation.XmlAccessType; |
... | ... | |
17 | 18 |
import javax.xml.bind.annotation.XmlType; |
18 | 19 |
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; |
19 | 20 |
|
20 |
import org.joda.time.DateTime; |
|
21 |
|
|
22 | 21 |
import eu.etaxonomy.cdm.jaxb.DateTimeAdapter; |
23 | 22 |
import eu.etaxonomy.cdm.remote.dto.dc.Relation; |
24 | 23 |
import eu.etaxonomy.cdm.remote.dto.tdwg.voc.LinkType; |
... | ... | |
48 | 47 |
"publishedInCitation" |
49 | 48 |
}) |
50 | 49 |
public abstract class BaseThing { |
51 |
|
|
50 |
|
|
52 | 51 |
@XmlElement(namespace = "http://purl.org/dc/elements/1.1/") |
53 | 52 |
private String title; |
54 |
|
|
53 |
|
|
55 | 54 |
@XmlElement(namespace = "http://www.w3.org/2002/07/owl#") |
56 | 55 |
private String sameAs; |
57 |
|
|
56 |
|
|
58 | 57 |
@XmlElement(namespace = "http://purl.org/dc/elements/1.1/") |
59 | 58 |
private URI identifier; |
60 |
|
|
59 |
|
|
61 | 60 |
@XmlElement(namespace = "http://purl.org/dc/terms/") |
62 | 61 |
@XmlJavaTypeAdapter(DateTimeAdapter.class) |
63 |
private DateTime created; |
|
64 |
|
|
62 |
private ZonedDateTime created;
|
|
63 |
|
|
65 | 64 |
@XmlElement(namespace = "http://purl.org/dc/terms/") |
66 | 65 |
@XmlJavaTypeAdapter(DateTimeAdapter.class) |
67 |
private DateTime date; |
|
66 |
private ZonedDateTime date;
|
|
68 | 67 |
|
69 | 68 |
@XmlElement(namespace = "http://purl.org/dc/elements/1.1/") |
70 | 69 |
private String creator; |
71 |
|
|
70 |
|
|
72 | 71 |
@XmlElement(namespace = "http://purl.org/dc/elements/1.1/") |
73 | 72 |
private String contributor; |
74 |
|
|
73 |
|
|
75 | 74 |
@XmlElement(name = "relation", namespace = "http://purl.org/dc/elements/1.1/") |
76 | 75 |
private Relation relation; |
77 |
|
|
76 |
|
|
78 | 77 |
@XmlElement |
79 | 78 |
private String abcdEquivalence; |
80 |
|
|
79 |
|
|
81 | 80 |
@XmlElement |
82 | 81 |
private String berlinModelEquivalence; |
83 |
|
|
82 |
|
|
84 | 83 |
@XmlElement |
85 | 84 |
private String darwinCoreEquivalence; |
86 |
|
|
85 |
|
|
87 | 86 |
@XmlElement(name = "isDeprecated") |
88 | 87 |
private Boolean deprecated; |
89 |
|
|
88 |
|
|
90 | 89 |
@XmlElement(name = "isRestricted") |
91 | 90 |
private Boolean restricted; |
92 |
|
|
91 |
|
|
93 | 92 |
@XmlElement |
94 | 93 |
private String microReference; |
95 |
|
|
94 |
|
|
96 | 95 |
@XmlElement |
97 | 96 |
private Set<String> notes; |
98 |
|
|
97 |
|
|
99 | 98 |
@XmlElement |
100 | 99 |
private String publishedIn; |
101 | 100 |
|
... | ... | |
110 | 109 |
|
111 | 110 |
@XmlElement(name = "publishedInCitation") |
112 | 111 |
private PublishedInCitation publishedInCitation; |
113 |
|
|
114 |
public DateTime getDate() { |
|
112 |
|
|
113 |
public ZonedDateTime getDate() {
|
|
115 | 114 |
return date; |
116 | 115 |
} |
117 | 116 |
|
118 |
public void setDate(DateTime date) { |
|
117 |
public void setDate(ZonedDateTime date) {
|
|
119 | 118 |
this.date = date; |
120 | 119 |
} |
121 |
|
|
120 |
|
|
122 | 121 |
public String getCreator() { |
123 | 122 |
return creator; |
124 | 123 |
} |
... | ... | |
134 | 133 |
public void setContributor(String contributor) { |
135 | 134 |
this.contributor = contributor; |
136 | 135 |
} |
137 |
|
|
136 |
|
|
138 | 137 |
public String getAbcdEquivalence() { |
139 | 138 |
return abcdEquivalence; |
140 | 139 |
} |
141 |
|
|
140 |
|
|
142 | 141 |
public String getBerlinModelEquivalence() { |
143 | 142 |
return berlinModelEquivalence; |
144 | 143 |
} |
145 |
|
|
144 |
|
|
146 | 145 |
//dcterms:created |
147 |
public DateTime getCreated() { |
|
146 |
public ZonedDateTime getCreated() {
|
|
148 | 147 |
return created; |
149 | 148 |
} |
150 | 149 |
|
151 | 150 |
public String getDarwinCoreEquivalence() { |
152 | 151 |
return darwinCoreEquivalence; |
153 | 152 |
} |
154 |
|
|
153 |
|
|
155 | 154 |
//dc:identifier |
156 | 155 |
public URI getIdentifier() { |
157 | 156 |
return identifier; |
158 | 157 |
} |
159 |
|
|
158 |
|
|
160 | 159 |
public String getMicroReference() { |
161 | 160 |
return microReference; |
162 | 161 |
} |
... | ... | |
198 | 197 |
public Boolean isRestricted() { |
199 | 198 |
return restricted; |
200 | 199 |
} |
201 |
|
|
200 |
|
|
202 | 201 |
public void setDeprecated(Boolean deprecated) { |
203 | 202 |
this.deprecated = deprecated; |
204 | 203 |
} |
205 |
|
|
204 |
|
|
206 | 205 |
public void setIdentifier(URI identifier) { |
207 | 206 |
this.identifier = identifier; |
208 | 207 |
} |
209 |
|
|
208 |
|
|
210 | 209 |
public void setMicroReference(String microReference) { |
211 | 210 |
this.microReference = microReference; |
212 | 211 |
} |
213 |
|
|
212 |
|
|
214 | 213 |
public void setNotes(Set<String> notes) { |
215 | 214 |
this.notes = notes; |
216 | 215 |
} |
217 |
|
|
216 |
|
|
218 | 217 |
public void setPublishedIn(String publishedIn) { |
219 | 218 |
this.publishedIn = publishedIn; |
220 | 219 |
} |
221 |
|
|
220 |
|
|
222 | 221 |
public void setRestricted(Boolean restricted) { |
223 | 222 |
this.restricted = restricted; |
224 |
}
|
|
225 |
|
|
223 |
} |
|
224 |
|
|
226 | 225 |
public void setSameAs(String sameAs) { |
227 | 226 |
this.sameAs = sameAs; |
228 | 227 |
} |
229 |
|
|
228 |
|
|
230 | 229 |
public void setTaxonomicPlacementFormal(String taxonomicPlacementFormal) { |
231 | 230 |
this.taxonomicPlacementFormal = taxonomicPlacementFormal; |
232 | 231 |
} |
233 |
|
|
232 |
|
|
234 | 233 |
public void setTaxonomicPlacementInformal(String taxonomicPlacementInformal) { |
235 | 234 |
this.taxonomicPlacementInformal = taxonomicPlacementInformal; |
236 | 235 |
} |
... | ... | |
243 | 242 |
this.title = title; |
244 | 243 |
} |
245 | 244 |
|
246 |
public void setCreated(DateTime created) { |
|
245 |
public void setCreated(ZonedDateTime created) {
|
|
247 | 246 |
this.created = created; |
248 | 247 |
} |
249 | 248 |
|
250 | 249 |
public void setPublishedInCitation(PublicationCitation publicationCitation) { |
251 | 250 |
this.publishedInCitation = new PublishedInCitation(publicationCitation, false); |
252 | 251 |
} |
253 |
|
|
252 |
|
|
254 | 253 |
public PublicationCitation getPublishedInCitation() { |
255 | 254 |
return publishedInCitation != null ? publishedInCitation.getPublicationCitation() : null; |
256 | 255 |
} |
257 |
|
|
256 |
|
|
258 | 257 |
public void setPublishedInCitationRelation(PublicationCitation publicationCitation) { |
259 | 258 |
this.publishedInCitation = new PublishedInCitation(publicationCitation, true); |
260 | 259 |
} |
261 |
|
|
260 |
|
|
262 | 261 |
public PublicationCitation getPublishedInCitationRelation() { |
263 | 262 |
return publishedInCitation != null ? publishedInCitation.getPublicationCitation() : null; |
264 | 263 |
} |
... | ... | |
270 | 269 |
public Relation getRelation() { |
271 | 270 |
return relation; |
272 | 271 |
} |
273 |
|
|
272 |
|
|
274 | 273 |
@XmlAccessorType(XmlAccessType.FIELD) |
275 | 274 |
@XmlType(name = "", propOrder = { |
276 | 275 |
"publicationCitation" |
277 | 276 |
}) |
278 | 277 |
public static class PublishedInCitation extends LinkType { |
279 |
|
|
278 |
|
|
280 | 279 |
@XmlElement(name = "PublicationCitation", namespace = "http://rs.tdwg.org/ontology/voc/PublicationCitation#") |
281 | 280 |
private PublicationCitation publicationCitation; |
282 |
|
|
281 |
|
|
283 | 282 |
protected PublishedInCitation() {} |
284 |
|
|
283 |
|
|
285 | 284 |
protected PublishedInCitation(PublicationCitation publicationCitation, boolean useRelation) { |
286 | 285 |
if(useRelation) { |
287 | 286 |
if(publicationCitation != null && publicationCitation.getIdentifier() != null) { |
Also available in: Unified diff
first implementation for change from joda time to java8 time