Project

General

Profile

Download (19.3 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2008 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
 *
6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7
 * See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

    
10
package eu.etaxonomy.cdm.io.jaxb;
11

    
12
import java.util.ArrayList;
13
import java.util.Collection;
14
import java.util.List;
15

    
16
import javax.xml.bind.annotation.XmlAccessType;
17
import javax.xml.bind.annotation.XmlAccessorType;
18
import javax.xml.bind.annotation.XmlElement;
19
import javax.xml.bind.annotation.XmlElementWrapper;
20
import javax.xml.bind.annotation.XmlElements;
21
import javax.xml.bind.annotation.XmlRootElement;
22
import javax.xml.bind.annotation.XmlType;
23

    
24
import org.springframework.security.core.GrantedAuthority;
25

    
26
import eu.etaxonomy.cdm.io.common.IExportData;
27
import eu.etaxonomy.cdm.model.agent.AgentBase;
28
import eu.etaxonomy.cdm.model.agent.Institution;
29
import eu.etaxonomy.cdm.model.agent.Person;
30
import eu.etaxonomy.cdm.model.agent.Team;
31
import eu.etaxonomy.cdm.model.common.AnnotationType;
32
import eu.etaxonomy.cdm.model.common.EventBase;
33
import eu.etaxonomy.cdm.model.common.ExtensionType;
34
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
35
import eu.etaxonomy.cdm.model.common.Group;
36
import eu.etaxonomy.cdm.model.common.Language;
37
import eu.etaxonomy.cdm.model.common.LanguageString;
38
import eu.etaxonomy.cdm.model.common.MarkerType;
39
import eu.etaxonomy.cdm.model.common.User;
40
import eu.etaxonomy.cdm.model.description.Feature;
41
import eu.etaxonomy.cdm.model.description.MeasurementUnit;
42
import eu.etaxonomy.cdm.model.description.MediaKey;
43
import eu.etaxonomy.cdm.model.description.PolytomousKey;
44
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
45
import eu.etaxonomy.cdm.model.description.State;
46
import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
47
import eu.etaxonomy.cdm.model.description.TextFormat;
48
import eu.etaxonomy.cdm.model.location.Country;
49
import eu.etaxonomy.cdm.model.location.NamedArea;
50
import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
51
import eu.etaxonomy.cdm.model.location.NamedAreaType;
52
import eu.etaxonomy.cdm.model.location.ReferenceSystem;
53
import eu.etaxonomy.cdm.model.media.Media;
54
import eu.etaxonomy.cdm.model.media.RightsType;
55
import eu.etaxonomy.cdm.model.molecular.DnaSample;
56
import eu.etaxonomy.cdm.model.molecular.PhylogeneticTree;
57
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
58
import eu.etaxonomy.cdm.model.name.HybridRelationshipType;
59
import eu.etaxonomy.cdm.model.name.NameRelationshipType;
60
import eu.etaxonomy.cdm.model.name.NameTypeDesignation;
61
import eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus;
62
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
63
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
64
import eu.etaxonomy.cdm.model.name.Rank;
65
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
66
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
67
import eu.etaxonomy.cdm.model.name.TaxonName;
68
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
69
import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
70
import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
71
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
72
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
73
import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;
74
import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
75
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
76
import eu.etaxonomy.cdm.model.reference.Reference;
77
import eu.etaxonomy.cdm.model.taxon.Classification;
78
import eu.etaxonomy.cdm.model.taxon.Synonym;
79
import eu.etaxonomy.cdm.model.taxon.SynonymType;
80
import eu.etaxonomy.cdm.model.taxon.Taxon;
81
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
82
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
83
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
84
import eu.etaxonomy.cdm.model.term.DefinedTerm;
85
import eu.etaxonomy.cdm.model.term.DefinedTermBase;
86
import eu.etaxonomy.cdm.model.term.FeatureTree;
87
import eu.etaxonomy.cdm.model.term.OrderedTermVocabulary;
88
import eu.etaxonomy.cdm.model.term.TermVocabulary;
89

    
90
/**
91
 * @author a.babadshanjan
92
 */
93
@XmlAccessorType(XmlAccessType.FIELD)
94
@XmlType(name = "DataSet", propOrder = {
95
	    "terms",
96
	    "termVocabularies",
97
		"agents",
98
		"collections",
99
		"occurrences",
100
		"eventBases",
101
	    "references",
102
	    "typeDesignations",
103
	    "featureTrees",
104
	    "polytomousKeys",
105
	    "taxonNodes",
106
	    "classifications",
107
	    "taxonomicNames",
108
	    "homotypicalGroups",
109
	    "taxonBases",
110
	    "media",
111
	    "users",
112
	    "groups",
113
	    "grantedAuthorities",
114
	    "languageStrings"
115
})
116
@XmlRootElement(name = "DataSet")
117
public class DataSet implements IExportData {
118

    
119
    private static final long serialVersionUID = -657623965517589622L;
120

    
121
    @XmlElementWrapper(name = "Terms")
122
    @XmlElements({
123
    	@XmlElement(name = "AnnotationType", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = AnnotationType.class),
124
    	@XmlElement(name = "Continent", namespace = "http://etaxonomy.eu/cdm/model/location/1.0", type = NamedArea.class),
125
    	@XmlElement(name = "DerivationEventType", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = DerivationEventType.class),
126
    	@XmlElement(name = "DeterminationModifier", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = DefinedTerm.class),
127
    	@XmlElement(name = "ExtensionType", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = ExtensionType.class),
128
    	@XmlElement(name = "Feature", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = Feature.class),
129
    	@XmlElement(name = "HybridRelationshipType", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = HybridRelationshipType.class),
130
    	@XmlElement(name = "InstitutionType", namespace = "http://etaxonomy.eu/cdm/model/agent/1.0", type = DefinedTerm.class),
131
    	@XmlElement(name = "Language", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = Language.class),
132
    	@XmlElement(name = "MarkerType", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = MarkerType.class),
133
    	@XmlElement(name = "MeasurementUnit", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = MeasurementUnit.class),
134
    	@XmlElement(name = "Modifier", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = DefinedTerm.class),
135
    	@XmlElement(name = "NamedArea", namespace = "http://etaxonomy.eu/cdm/model/location/1.0", type = NamedArea.class),
136
    	@XmlElement(name = "NamedAreaLevel", namespace = "http://etaxonomy.eu/cdm/model/location/1.0", type = NamedAreaLevel.class),
137
    	@XmlElement(name = "NamedAreaType", namespace = "http://etaxonomy.eu/cdm/model/location/1.0", type = NamedAreaType.class),
138
    	@XmlElement(name = "NameRelationshipType", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = NameRelationshipType.class),
139
    	@XmlElement(name = "NameTypeDesignationStatus", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = NameTypeDesignationStatus.class),
140
    	@XmlElement(name = "NomenclaturalCode", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = NomenclaturalCode.class),
141
    	@XmlElement(name = "NomenclaturalStatusType", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = NomenclaturalStatusType.class),
142
    	@XmlElement(name = "PresenceAbsenceTerm", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = PresenceAbsenceTerm.class),
143
    	@XmlElement(name = "PreservationMethod", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = PreservationMethod.class),
144
        @XmlElement(name = "Rank", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = Rank.class),
145
    	@XmlElement(name = "ReferenceSystem", namespace = "http://etaxonomy.eu/cdm/model/location/1.0", type = ReferenceSystem.class),
146
    	@XmlElement(name = "RightsType", namespace = "http://etaxonomy.eu/cdm/model/media/1.0", type = RightsType.class),
147
    	@XmlElement(name = "Scope", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = DefinedTerm.class),
148
    	@XmlElement(name = "Sex", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = DefinedTerm.class),
149
    	@XmlElement(name = "SpecimenTypeDesignationStatus", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = SpecimenTypeDesignationStatus.class),
150
    	@XmlElement(name = "Stage", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = DefinedTerm.class),
151
    	@XmlElement(name = "State", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = State.class),
152
    	@XmlElement(name = "StatisticalMeasure", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = StatisticalMeasure.class),
153
    	@XmlElement(name = "SynonymType", namespace = "http://etaxonomy.eu/cdm/model/taxon/1.0", type = SynonymType.class),
154
    	@XmlElement(name = "TaxonRelationshipType", namespace = "http://etaxonomy.eu/cdm/model/taxon/1.0", type = TaxonRelationshipType.class),
155
    	//    	@XmlElement(name = "TdwgArea", namespace = "http://etaxonomy.eu/cdm/model/location/1.0", type = TdwgArea.class),
156
    	@XmlElement(name = "TextFormat", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = TextFormat.class),
157
    	@XmlElement(name = "Country", namespace = "http://etaxonomy.eu/cdm/model/location/1.0", type = Country.class)
158

    
159
    })
160
    protected List<DefinedTermBase> terms = new ArrayList<>();
161

    
162
	@XmlElementWrapper(name = "TermVocabularies")
163
    @XmlElements({
164
        @XmlElement(name = "TermVocabulary", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = TermVocabulary.class),
165
        @XmlElement(name = "OrderedTermVocabulary", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = OrderedTermVocabulary.class)
166
    })
167

    
168
    protected List<TermVocabulary<DefinedTermBase>> termVocabularies = new ArrayList<>();
169

    
170

    
171
    @XmlElementWrapper(name = "Agents")
172
    @XmlElements({
173
        @XmlElement(name = "Team", namespace = "http://etaxonomy.eu/cdm/model/agent/1.0", type = Team.class),
174
        @XmlElement(name = "Institution", namespace = "http://etaxonomy.eu/cdm/model/agent/1.0", type = Institution.class),
175
        @XmlElement(name = "Person", namespace = "http://etaxonomy.eu/cdm/model/agent/1.0", type = Person.class)
176
    })
177
    protected List<AgentBase> agents = new ArrayList<>();
178

    
179

    
180
    @XmlElementWrapper(name = "Collections")
181
    @XmlElement(name = "Collection", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0")
182
    protected List<eu.etaxonomy.cdm.model.occurrence.Collection> collections = new ArrayList<>();
183

    
184
    @XmlElementWrapper(name = "FeatureTrees")
185
    @XmlElements({
186
      @XmlElement(name = "FeatureTree", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = FeatureTree.class)
187
    })
188
    protected List<FeatureTree> featureTrees = new ArrayList<>();
189

    
190
    @XmlElementWrapper(name = "PolytomousKeys")
191
    @XmlElements({
192
      @XmlElement(name = "PolytomousKey", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = PolytomousKey.class)
193
    })
194
    protected List<PolytomousKey> polytomousKeys = new ArrayList<>();
195

    
196

    
197
    @XmlElementWrapper(name = "Classifications")
198
    @XmlElement(name = "Classification", namespace = "http://etaxonomy.eu/cdm/model/taxon/1.0")
199
    protected List<Classification> classifications = new ArrayList<>();
200

    
201
    @XmlElementWrapper(name = "TaxonNodes")
202
    @XmlElement(name = "TaxonNodes", namespace = "http://etaxonomy.eu/cdm/model/taxon/1.0")
203
    protected List<TaxonNode> taxonNodes = new ArrayList<>();
204

    
205
    protected List<LanguageString> languageStrings =new ArrayList<>();
206

    
207

    
208
    @XmlElementWrapper(name = "Occurrences")
209
    @XmlElements({
210
    	@XmlElement(name = "DerivedUnit", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = DerivedUnit.class),
211
    	@XmlElement(name = "DnaSample", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = DnaSample.class),
212
    	@XmlElement(name = "FieldUnit", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = FieldUnit.class)
213
    })
214
    protected List<SpecimenOrObservationBase> occurrences = new ArrayList<>();
215

    
216
    @XmlElementWrapper(name = "EventBases")
217
    @XmlElements({
218
    	@XmlElement(name = "DerivationEvent", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = DerivationEvent.class),
219
    	@XmlElement(name = "GatheringEvent", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = GatheringEvent.class)
220
    })
221
    protected List<EventBase> eventBases = new ArrayList<>();
222

    
223
    @XmlElementWrapper(name = "References")
224
    @XmlElements({
225
    	@XmlElement(name = "Reference", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = Reference.class)
226
    })
227
    protected List<Reference> references = new ArrayList<>();
228

    
229
    @XmlElementWrapper(name = "TypeDesignations")
230
    @XmlElements({
231
    	@XmlElement(name = "NameTypeDesignation", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = NameTypeDesignation.class),
232
    	@XmlElement(name = "SpecimenTypeDesignation", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = SpecimenTypeDesignation.class)
233
    })
234
    protected List<TypeDesignationBase<?>> typeDesignations = new ArrayList<>();
235

    
236
    @XmlElementWrapper(name = "TaxonomicNames")
237
    @XmlElements({
238
    	@XmlElement(name = "TaxonName", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = TaxonName.class),
239
     })
240
    protected List<TaxonName> taxonomicNames = new ArrayList<>();
241

    
242
    @XmlElementWrapper(name = "TaxonBases")
243
    @XmlElements({
244
      @XmlElement(name = "Taxon", namespace = "http://etaxonomy.eu/cdm/model/taxon/1.0", type = Taxon.class),
245
      @XmlElement(name = "Synonym", namespace = "http://etaxonomy.eu/cdm/model/taxon/1.0", type = Synonym.class)
246
    })
247
    protected List<TaxonBase<?>> taxonBases = new ArrayList<>();
248

    
249
    @XmlElementWrapper(name = "Media")
250
    @XmlElements({
251
      @XmlElement(name = "Media", namespace = "http://etaxonomy.eu/cdm/model/media/1.0", type = Media.class),
252
      @XmlElement(name = "MediaKey", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = MediaKey.class),
253
      @XmlElement(name = "PhylogeneticTree", namespace = "http://etaxonomy.eu/cdm/model/molecular/1.0", type = PhylogeneticTree.class)
254
    })
255
    protected List<Media> media = new ArrayList<>();
256

    
257
    @XmlElementWrapper(name = "HomotypicalGroups")
258
    @XmlElement(name = "HomotypicalGroup", namespace = "http://etaxonomy.eu/cdm/model/name/1.0")
259
    protected List<HomotypicalGroup> homotypicalGroups = new ArrayList<>();
260

    
261
    @XmlElementWrapper(name = "Users")
262
    @XmlElement(name = "User", namespace = "http://etaxonomy.eu/cdm/model/common/1.0")
263
    protected List<User> users = new ArrayList<>();
264

    
265
    @XmlElementWrapper(name = "Groups")
266
    @XmlElement(name = "Group", namespace = "http://etaxonomy.eu/cdm/model/common/1.0")
267
    protected List<Group> groups = new ArrayList<>();
268

    
269
    @XmlElementWrapper(name = "GrantedAuthorities")
270
    @XmlElement(name = "GrantedAuthority", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = GrantedAuthorityImpl.class)
271
    protected List<GrantedAuthority> grantedAuthorities = new ArrayList<GrantedAuthority>();
272

    
273
    public List<AgentBase> getAgents() {
274
        return agents;
275
    }
276
    public void setAgents(List<AgentBase> value) {
277
        this.agents = value;
278
    }
279

    
280
    public List<eu.etaxonomy.cdm.model.occurrence.Collection> getCollections() {
281
        return collections;
282
    }
283
    public void setCollections(List<eu.etaxonomy.cdm.model.occurrence.Collection> value) {
284
        this.collections = value;
285
    }
286

    
287
    public List<DefinedTermBase> getTerms() {
288
        return terms;
289
    }
290
    public void setTerms(List<DefinedTermBase> value) {
291
        this.terms = value;
292
    }
293

    
294
    public List<TermVocabulary<DefinedTermBase>> getTermVocabularies() {
295
        return termVocabularies;
296
    }
297
    public void setTermVocabularies(List<TermVocabulary<DefinedTermBase>> value) {
298
        this.termVocabularies = value;
299
    }
300

    
301
    public List<TaxonName> getTaxonomicNames() {
302
        return taxonomicNames;
303
    }
304
    public void setTaxonomicNames(List<TaxonName> value) {
305
        this.taxonomicNames = value;
306
    }
307

    
308
    public List<EventBase> getEventBases() {
309
        return eventBases;
310
    }
311
    public void setEventBases(List<EventBase> value) {
312
        this.eventBases = value;
313
    }
314

    
315
    public List<SpecimenOrObservationBase> getOccurrences() {
316
        return occurrences;
317
    }
318
    public void setOccurrences(List<SpecimenOrObservationBase> value) {
319
        this.occurrences = value;
320
    }
321

    
322
    public List<LanguageString> getLanguageStrings() {
323
       return languageStrings;
324
    }
325

    
326
    public void setLanguageStrings(List<LanguageString> value) {
327
       this.languageStrings = value;
328
    }
329

    
330
    public List<Reference> getReferences() {
331
        return references;
332
    }
333
    public void setReferences(List<Reference> value) {
334
        this.references = value;
335
    }
336

    
337
    public List<FeatureTree> getFeatureTrees() {
338
        return featureTrees;
339
    }
340

    
341
    public List<PolytomousKey> getPolytomousKeys() {
342
        return polytomousKeys;
343
    }
344

    
345
    public void setClassifications(List<Classification> value) {
346
    	this.classifications = value;
347
    }
348
    public List<Classification> getClassifications() {
349
        return classifications;
350
    }
351

    
352
    public void setTaxonNodes(List<TaxonNode> value) {
353
    	this.taxonNodes = value;
354
    }
355
    public List<TaxonNode> getTaxonNodes() {
356
        return taxonNodes;
357
    }
358

    
359
    public void setFeatureTrees(List<FeatureTree> value) {
360
    	this.featureTrees = value;
361
    }
362

    
363
    public void setPolytomousKeys(List<PolytomousKey> value) {
364
    	this.polytomousKeys = value;
365
    }
366

    
367
    public void addTaxonBases(Collection<TaxonBase<?>> value) {
368
    	this.taxonBases.addAll(value);
369
    }
370
    public List<TaxonBase<?>> getTaxonBases() {
371
    	return taxonBases;
372
    }
373
    public void setTaxonBases(List<TaxonBase<?>> value) {
374
        this.taxonBases = value;
375
    }
376
    public void addTaxonBase(TaxonBase value) {
377
    		this.taxonBases.add(value);
378
    }
379

    
380
    public <T extends Media> void addMedia(Collection<T> value) {
381
    	for (T medium: value) {
382
    		this.media.add(medium);
383
    	}
384
    }
385

    
386
    public List<Media> getMedia() {
387
        return media;
388
    }
389

    
390
    public void setMedia(List<Media> value) {
391
        this.media = new ArrayList<>();
392
        media.addAll(value);
393
    }
394

    
395
    public List<HomotypicalGroup> getHomotypicalGroups() {
396
        return homotypicalGroups;
397
    }
398

    
399
    public void setHomotypicalGroups(List<HomotypicalGroup> value) {
400
        this.homotypicalGroups = value;
401
    }
402

    
403
    public List<TypeDesignationBase<?>> getTypeDesignations() {
404
    	return typeDesignations;
405
    }
406

    
407
	public void addTypeDesignations(List<TypeDesignationBase<?>> typeDesignations) {
408
		this.typeDesignations.addAll(typeDesignations);
409
	}
410

    
411
	public List<User> getUsers() {
412
		return users;
413
	}
414
	public void setUsers(List<User> users) {
415
		this.users = users;
416
	}
417
	public void addUser(User deproxy) {
418
        this.users.add(deproxy);
419
    }
420

    
421
	public List<Group> getGroups() {
422
		return groups;
423
	}
424
	public void setGroups(List<Group> groups) {
425
		this.groups = groups;
426
	}
427

    
428
	public List<GrantedAuthority> getGrantedAuthorities() {
429
		return grantedAuthorities;
430
	}
431
	public void setGrantedAuthorities(List<GrantedAuthority> grantedAuthorities) {
432
		this.grantedAuthorities = grantedAuthorities;
433
	}
434

    
435
}
(6-6/17)