1f9c543f2895e7125539558d38e3eee3d8bdac01
[cdmlib.git] / cdmlib-io / src / main / java / eu / etaxonomy / cdm / io / jaxb / DataSet.java
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.HashSet;
15 import java.util.List;
16 import java.util.Set;
17
18 import javax.xml.bind.annotation.XmlAccessType;
19 import javax.xml.bind.annotation.XmlAccessorType;
20 import javax.xml.bind.annotation.XmlElement;
21 import javax.xml.bind.annotation.XmlElementWrapper;
22 import javax.xml.bind.annotation.XmlElements;
23 import javax.xml.bind.annotation.XmlRootElement;
24 import javax.xml.bind.annotation.XmlType;
25
26 import eu.etaxonomy.cdm.model.agent.Address;
27 import eu.etaxonomy.cdm.model.agent.Agent;
28 import eu.etaxonomy.cdm.model.agent.Contact;
29 import eu.etaxonomy.cdm.model.agent.Institution;
30 import eu.etaxonomy.cdm.model.agent.InstitutionType;
31 import eu.etaxonomy.cdm.model.agent.InstitutionalMembership;
32 import eu.etaxonomy.cdm.model.agent.Person;
33 import eu.etaxonomy.cdm.model.agent.Team;
34 import eu.etaxonomy.cdm.model.common.AnnotationType;
35 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
36 import eu.etaxonomy.cdm.model.common.ExtensionType;
37 import eu.etaxonomy.cdm.model.common.Keyword;
38 import eu.etaxonomy.cdm.model.common.Language;
39 import eu.etaxonomy.cdm.model.common.LanguageString;
40 import eu.etaxonomy.cdm.model.common.LanguageStringBase;
41 import eu.etaxonomy.cdm.model.common.MarkerType;
42 import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
43 import eu.etaxonomy.cdm.model.common.RelationshipBase;
44 import eu.etaxonomy.cdm.model.common.Representation;
45 import eu.etaxonomy.cdm.model.common.TermVocabulary;
46 import eu.etaxonomy.cdm.model.common.VersionableEntity;
47 import eu.etaxonomy.cdm.model.description.AbsenceTerm;
48 import eu.etaxonomy.cdm.model.description.Feature;
49 import eu.etaxonomy.cdm.model.description.FeatureNode;
50 import eu.etaxonomy.cdm.model.description.FeatureTree;
51 import eu.etaxonomy.cdm.model.description.MeasurementUnit;
52 import eu.etaxonomy.cdm.model.description.Modifier;
53 import eu.etaxonomy.cdm.model.description.PresenceTerm;
54 import eu.etaxonomy.cdm.model.description.Scope;
55 import eu.etaxonomy.cdm.model.description.Sex;
56 import eu.etaxonomy.cdm.model.description.Stage;
57 import eu.etaxonomy.cdm.model.description.State;
58 import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
59 import eu.etaxonomy.cdm.model.description.TextFormat;
60 import eu.etaxonomy.cdm.model.location.Continent;
61 import eu.etaxonomy.cdm.model.location.NamedArea;
62 import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
63 import eu.etaxonomy.cdm.model.location.NamedAreaType;
64 import eu.etaxonomy.cdm.model.location.ReferenceSystem;
65 import eu.etaxonomy.cdm.model.location.WaterbodyOrCountry;
66 import eu.etaxonomy.cdm.model.media.Media;
67 import eu.etaxonomy.cdm.model.media.RightsTerm;
68 import eu.etaxonomy.cdm.model.molecular.DnaSample;
69 import eu.etaxonomy.cdm.model.name.BacterialName;
70 import eu.etaxonomy.cdm.model.name.BotanicalName;
71 import eu.etaxonomy.cdm.model.name.CultivarPlantName;
72 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
73 import eu.etaxonomy.cdm.model.name.HybridRelationship;
74 import eu.etaxonomy.cdm.model.name.HybridRelationshipType;
75 import eu.etaxonomy.cdm.model.name.NameRelationship;
76 import eu.etaxonomy.cdm.model.name.NameRelationshipType;
77 import eu.etaxonomy.cdm.model.name.NameTypeDesignation;
78 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
79 import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;
80 import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
81 import eu.etaxonomy.cdm.model.name.NonViralName;
82 import eu.etaxonomy.cdm.model.name.Rank;
83 import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
84 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
85 import eu.etaxonomy.cdm.model.name.TypeDesignationStatus;
86 import eu.etaxonomy.cdm.model.name.ViralName;
87 import eu.etaxonomy.cdm.model.name.ZoologicalName;
88 import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
89 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
90 import eu.etaxonomy.cdm.model.occurrence.DeterminationModifier;
91 import eu.etaxonomy.cdm.model.occurrence.FieldObservation;
92 import eu.etaxonomy.cdm.model.occurrence.Fossil;
93 import eu.etaxonomy.cdm.model.occurrence.LivingBeing;
94 import eu.etaxonomy.cdm.model.occurrence.Observation;
95 import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
96 import eu.etaxonomy.cdm.model.occurrence.Specimen;
97 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
98 import eu.etaxonomy.cdm.model.reference.Article;
99 import eu.etaxonomy.cdm.model.reference.BibtexEntryType;
100 import eu.etaxonomy.cdm.model.reference.Book;
101 import eu.etaxonomy.cdm.model.reference.BookSection;
102 import eu.etaxonomy.cdm.model.reference.CdDvd;
103 import eu.etaxonomy.cdm.model.reference.Database;
104 import eu.etaxonomy.cdm.model.reference.Generic;
105 import eu.etaxonomy.cdm.model.reference.InProceedings;
106 import eu.etaxonomy.cdm.model.reference.Journal;
107 import eu.etaxonomy.cdm.model.reference.Map;
108 import eu.etaxonomy.cdm.model.reference.Patent;
109 import eu.etaxonomy.cdm.model.reference.PersonalCommunication;
110 import eu.etaxonomy.cdm.model.reference.PrintSeries;
111 import eu.etaxonomy.cdm.model.reference.Proceedings;
112 import eu.etaxonomy.cdm.model.reference.ReferenceBase;
113 import eu.etaxonomy.cdm.model.reference.Report;
114 import eu.etaxonomy.cdm.model.reference.Thesis;
115 import eu.etaxonomy.cdm.model.reference.WebPage;
116 import eu.etaxonomy.cdm.model.taxon.Synonym;
117 import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
118 import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
119 import eu.etaxonomy.cdm.model.taxon.Taxon;
120 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
121 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
122 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
123
124 /**
125 * @author a.babadshanjan
126 */
127 @XmlAccessorType(XmlAccessType.FIELD)
128 @XmlType(name = "", propOrder = {
129 "terms",
130 "termVocabularies",
131 "agents",
132 "agentData",
133 "occurrences",
134 "references",
135 "referencedEntities",
136 "featureData",
137 "languageData",
138 "taxonomicNames",
139 "homotypicalGroups",
140 "taxa",
141 "synonyms",
142 "relationships",
143 "media"
144 })
145 @XmlRootElement(name = "DataSet", namespace = "http://etaxonomy.eu/cdm/model/1.0")
146 public class DataSet {
147
148 // Some fields are of type List and some are of type Set.
149 // This is mainly because
150 // the service classes return lists, i.e.
151 // TaxonServiceImpl.getRootTaxa() returns List<Taxon>
152 // and the Taxon methods return sets, i.e.
153 // Taxon.getTaxonomicChildren() returns Set<Taxon>.
154
155 @XmlElementWrapper(name = "Agents", namespace = "http://etaxonomy.eu/cdm/model/1.0")
156 @XmlElements({
157 @XmlElement(name = "Team", namespace = "http://etaxonomy.eu/cdm/model/agent/1.0", type = Team.class),
158 @XmlElement(name = "Institution", namespace = "http://etaxonomy.eu/cdm/model/agent/1.0", type = Institution.class),
159 @XmlElement(name = "Person", namespace = "http://etaxonomy.eu/cdm/model/agent/1.0", type = Person.class)
160 })
161 protected List<? extends Agent> agents;
162
163 @XmlElementWrapper(name = "AgentData", namespace = "http://etaxonomy.eu/cdm/model/1.0")
164 @XmlElements({
165 @XmlElement(name = "Address", namespace = "http://etaxonomy.eu/cdm/model/agent/1.0", type = Address.class),
166 @XmlElement(name = "Contact", namespace = "http://etaxonomy.eu/cdm/model/agent/1.0", type = Contact.class),
167 @XmlElement(name = "InstitutionalMembership", namespace = "http://etaxonomy.eu/cdm/model/agent/1.0", type = InstitutionalMembership.class)
168 })
169 protected List<VersionableEntity> agentData;
170
171 @XmlElementWrapper(name = "FeatureData", namespace = "http://etaxonomy.eu/cdm/model/1.0")
172 @XmlElements({
173 @XmlElement(name = "FeatureNode", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = FeatureNode.class),
174 @XmlElement(name = "FeatureTree", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = FeatureTree.class)
175 })
176 // protected List<VersionableEntity> featureData;
177 protected List<VersionableEntity> featureData;
178
179 @XmlElementWrapper(name = "LanguageData", namespace = "http://etaxonomy.eu/cdm/model/1.0")
180 @XmlElements({
181 @XmlElement(name = "Representation", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = Representation.class),
182 @XmlElement(name = "LanguageString", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = LanguageString.class)
183 })
184 protected List<LanguageStringBase> languageData;
185
186 @XmlElementWrapper(name = "Terms", namespace = "http://etaxonomy.eu/cdm/model/1.0")
187 @XmlElements({
188 @XmlElement(name = "AbsenceTerm", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = AbsenceTerm.class),
189 @XmlElement(name = "AnnotationType", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = AnnotationType.class),
190 @XmlElement(name = "BibtexEntryType", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = BibtexEntryType.class),
191 @XmlElement(name = "Continent", namespace = "http://etaxonomy.eu/cdm/model/location/1.0", type = Continent.class),
192 @XmlElement(name = "DerivationEventType", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = DerivationEventType.class),
193 @XmlElement(name = "DeterminationModifier", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = DeterminationModifier.class),
194 @XmlElement(name = "ExtensionType", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = ExtensionType.class),
195 @XmlElement(name = "Feature", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = Feature.class),
196 @XmlElement(name = "HybridRelationshipType", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = HybridRelationshipType.class),
197 @XmlElement(name = "InstitutionType", namespace = "http://etaxonomy.eu/cdm/model/agent/1.0", type = InstitutionType.class),
198 @XmlElement(name = "Keyword", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = Keyword.class),
199 @XmlElement(name = "Language", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = Language.class),
200 @XmlElement(name = "MarkerType", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = MarkerType.class),
201 @XmlElement(name = "MeasurementUnit", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = MeasurementUnit.class),
202 @XmlElement(name = "Modifier", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = Modifier.class),
203 @XmlElement(name = "NamedArea", namespace = "http://etaxonomy.eu/cdm/model/location/1.0", type = NamedArea.class),
204 @XmlElement(name = "NamedAreaLevel", namespace = "http://etaxonomy.eu/cdm/model/location/1.0", type = NamedAreaLevel.class),
205 @XmlElement(name = "NamedAreaType", namespace = "http://etaxonomy.eu/cdm/model/location/1.0", type = NamedAreaType.class),
206 @XmlElement(name = "NameRelationshipType", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = NameRelationshipType.class),
207 @XmlElement(name = "NomenclaturalCode", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = NomenclaturalCode.class),
208 @XmlElement(name = "NomenclaturalStatusType", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = NomenclaturalStatusType.class),
209 @XmlElement(name = "PresenceTerm", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = PresenceTerm.class),
210 @XmlElement(name = "PreservationMethod", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = PreservationMethod.class),
211 @XmlElement(name = "Rank", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = Rank.class),
212 @XmlElement(name = "ReferenceSystem", namespace = "http://etaxonomy.eu/cdm/model/location/1.0", type = ReferenceSystem.class),
213 @XmlElement(name = "RightsTerm", namespace = "http://etaxonomy.eu/cdm/model/media/1.0", type = RightsTerm.class),
214 @XmlElement(name = "Scope", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = Scope.class),
215 @XmlElement(name = "Sex", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = Sex.class),
216 @XmlElement(name = "Stage", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = Stage.class),
217 @XmlElement(name = "State", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = State.class),
218 @XmlElement(name = "StatisticalMeasure", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = StatisticalMeasure.class),
219 @XmlElement(name = "SynonymRelationshipType", namespace = "http://etaxonomy.eu/cdm/model/taxon/1.0", type = SynonymRelationshipType.class),
220 @XmlElement(name = "TaxonRelationshipType", namespace = "http://etaxonomy.eu/cdm/model/taxon/1.0", type = TaxonRelationshipType.class),
221 @XmlElement(name = "TextFormat", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = TextFormat.class),
222 @XmlElement(name = "TypeDesignationStatus", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = TypeDesignationStatus.class),
223 @XmlElement(name = "WaterbodyOrCountry", namespace = "http://etaxonomy.eu/cdm/model/location/1.0", type = WaterbodyOrCountry.class)
224 })
225 protected List<DefinedTermBase> terms;
226
227 @XmlElementWrapper(name = "TermVocabularies", namespace = "http://etaxonomy.eu/cdm/model/1.0")
228 @XmlElement(name = "TermVocabulary", namespace = "http://etaxonomy.eu/cdm/model/common/1.0")
229 protected List<TermVocabulary<DefinedTermBase>> termVocabularies;
230
231 @XmlElementWrapper(name = "Occurrences", namespace = "http://etaxonomy.eu/cdm/model/1.0")
232 @XmlElements({
233 @XmlElement(name = "DerivedUnit", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = DerivedUnit.class),
234 @XmlElement(name = "DnaSample", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = DnaSample.class),
235 @XmlElement(name = "FieldObservation", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = FieldObservation.class),
236 @XmlElement(name = "Fossil", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = Fossil.class),
237 @XmlElement(name = "LivingBeing", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = LivingBeing.class),
238 @XmlElement(name = "Observation", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = Observation.class),
239 @XmlElement(name = "Specimen", namespace = "http://etaxonomy.eu/cdm/model/occurrence/1.0", type = Specimen.class)
240 })
241 protected List<SpecimenOrObservationBase> occurrences;
242
243 @XmlElementWrapper(name = "References", namespace = "http://etaxonomy.eu/cdm/model/1.0")
244 @XmlElements({
245 @XmlElement(name = "Article", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = Article.class),
246 @XmlElement(name = "Book", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = Book.class),
247 @XmlElement(name = "BookSection", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = BookSection.class),
248 @XmlElement(name = "CdDvd", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = CdDvd.class),
249 @XmlElement(name = "Database", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = Database.class),
250 @XmlElement(name = "Generic", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = Generic.class),
251 @XmlElement(name = "InProceedings", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = InProceedings.class),
252 @XmlElement(name = "Journal", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = Journal.class),
253 @XmlElement(name = "Map", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = Map.class),
254 @XmlElement(name = "Patent", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = Patent.class),
255 @XmlElement(name = "PersonalCommunication", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = PersonalCommunication.class),
256 @XmlElement(name = "PrintSeries", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = PrintSeries.class),
257 @XmlElement(name = "Proceedings", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = Proceedings.class),
258 @XmlElement(name = "Report", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = Report.class),
259 @XmlElement(name = "Thesis", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = Thesis.class),
260 @XmlElement(name = "WebPage", namespace = "http://etaxonomy.eu/cdm/model/reference/1.0", type = WebPage.class)
261 })
262 protected List<ReferenceBase> references;
263
264 @XmlElementWrapper(name = "ReferencedEntities", namespace = "http://etaxonomy.eu/cdm/model/1.0")
265 @XmlElements({
266 @XmlElement(name = "NomenclaturalStatus", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = NomenclaturalStatus.class),
267 @XmlElement(name = "NameTypeDesignation", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = NameTypeDesignation.class),
268 @XmlElement(name = "SpecimenTypeDesignation", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = SpecimenTypeDesignation.class)
269 })
270 protected List<ReferencedEntityBase> referencedEntities;
271
272
273 @XmlElementWrapper(name = "TaxonomicNames", namespace = "http://etaxonomy.eu/cdm/model/1.0")
274 @XmlElements({
275 @XmlElement(name = "BacterialName", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = BacterialName.class),
276 @XmlElement(name = "BotanicalName", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = BotanicalName.class),
277 @XmlElement(name = "CultivarPlantName", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = CultivarPlantName.class),
278 @XmlElement(name = "NonViralName", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = NonViralName.class),
279 @XmlElement(name = "ViralName", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = ViralName.class),
280 @XmlElement(name = "ZoologicalName", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = ZoologicalName.class)
281 })
282 protected List<TaxonNameBase> taxonomicNames;
283
284 @XmlElementWrapper(name = "Taxa", namespace = "http://etaxonomy.eu/cdm/model/1.0")
285 @XmlElement(name = "Taxon", namespace = "http://etaxonomy.eu/cdm/model/taxon/1.0")
286 protected List<Taxon> taxa;
287
288 @XmlElementWrapper(name = "Synonyms", namespace = "http://etaxonomy.eu/cdm/model/1.0")
289 @XmlElement(name = "Synonym", namespace = "http://etaxonomy.eu/cdm/model/taxon/1.0")
290 protected List<Synonym> synonyms;
291
292 @XmlElementWrapper(name = "Relationships", namespace = "http://etaxonomy.eu/cdm/model/1.0")
293 @XmlElements({
294 @XmlElement(name = "TaxonRelationship", namespace = "http://etaxonomy.eu/cdm/model/taxon/1.0", type = TaxonRelationship.class),
295 @XmlElement(name = "SynonymRelationship", namespace = "http://etaxonomy.eu/cdm/model/taxon/1.0", type = SynonymRelationship.class),
296 @XmlElement(name = "NameRelationship", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = NameRelationship.class),
297 @XmlElement(name = "HybridRelationship", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = HybridRelationship.class)
298 })
299 protected Set<RelationshipBase> relationships;
300
301 @XmlElementWrapper(name = "Media", namespace = "http://etaxonomy.eu/cdm/model/1.0")
302 @XmlElement(name = "Media", namespace = "http://etaxonomy.eu/cdm/model/media/1.0")
303 protected List<Media> media;
304
305 @XmlElementWrapper(name = "HomotypicalGroups", namespace = "http://etaxonomy.eu/cdm/model/1.0")
306 @XmlElement(name = "HomotypicalGroup", namespace = "http://etaxonomy.eu/cdm/model/name/1.0")
307 protected List<HomotypicalGroup> homotypicalGroups;
308
309 // @XmlElement(name = "TdwgArea", namespace = "http://etaxonomy.eu/cdm/model/location/1.0", type = TdwgArea.class),
310
311 public DataSet () {
312
313 agents = new ArrayList<Agent>();
314 agentData = new ArrayList<VersionableEntity>();
315 // featureData = new ArrayList<VersionableEntity>();
316 featureData = new ArrayList<VersionableEntity>();
317 languageData = new ArrayList<LanguageStringBase>();
318 terms = new ArrayList<DefinedTermBase>();
319 termVocabularies = new ArrayList<TermVocabulary<DefinedTermBase>>();
320 occurrences = new ArrayList<SpecimenOrObservationBase>();
321 references = new ArrayList<ReferenceBase>();
322 referencedEntities = new ArrayList<ReferencedEntityBase>();
323 taxonomicNames = new ArrayList<TaxonNameBase>();
324 taxa = new ArrayList<Taxon>();
325 synonyms = new ArrayList<Synonym>();
326 relationships = new HashSet<RelationshipBase>();
327 media = new ArrayList<Media>();
328 homotypicalGroups = new ArrayList<HomotypicalGroup>();
329 }
330
331 /**
332 * Gets the value of the agents property.
333 *
334 * @return
335 * possible object is
336 * {@link List<Agent> }
337 *
338 */
339 public List<? extends Agent> getAgents() {
340 return agents;
341 }
342
343 /**
344 * Sets the value of the agents property.
345 *
346 * @param value
347 * allowed object is
348 * {@link List<Agent> }
349 *
350 */
351 public void setAgents(List<? extends Agent> value) {
352 this.agents = value;
353 }
354
355 /**
356 * Gets the value of the agentData property.
357 *
358 * @return
359 * possible object is
360 * {@link List<VersionableEntity> }
361 *
362 */
363 public List<VersionableEntity> getAgentData() {
364 return agentData;
365 }
366
367 /**
368 * Sets the value of the agentData property.
369 *
370 * @param value
371 * allowed object is
372 * {@link List<VersionableEntity> }
373 *
374 */
375 public void setAgentData(List<VersionableEntity> value) {
376 this.agentData = value;
377 }
378
379 /**
380 * Gets the value of the terms property.
381 *
382 * @return
383 * possible object is
384 * {@link List<TermBase> }
385 *
386 */
387
388 //public List<? extends TermBase> getTerms() {
389 public List<DefinedTermBase> getTerms() {
390 return terms;
391 }
392
393 /**
394 * Sets the value of the terms property.
395 *
396 * @param value
397 * allowed object is
398 * {@link List<TermBase> }
399 *
400 */
401 //public void setTerms(List<? extends TermBase> value) {
402 public void setTerms(List<DefinedTermBase> value) {
403 this.terms = value;
404 }
405
406 /**
407 * Gets the value of the term vocabularies property.
408 *
409 * @return
410 * possible object is
411 * {@link List<TermVocabulary> }
412 *
413 */
414
415 public List<TermVocabulary<DefinedTermBase>> getTermVocabularies() {
416 return termVocabularies;
417 }
418
419 /**
420 * Sets the value of the term vocabularies property.
421 *
422 * @param value
423 * allowed object is
424 * {@link List<TermVocabulary> }
425 *
426 */
427 public void setTermVocabularies(List<TermVocabulary<DefinedTermBase>> value) {
428 this.termVocabularies = value;
429 }
430
431 /**
432 * Gets the value of the taxonomicNames property.
433 *
434 * @return
435 * possible object is
436 * {@link List<axonNameBase> }
437 *
438 */
439 public List<TaxonNameBase> getTaxonomicNames() {
440 return taxonomicNames;
441 }
442
443 /**
444 * Sets the value of the taxonomicNames property.
445 *
446 * @param value
447 * allowed object is
448 * {@link List<TaxonNameBase> }
449 *
450 */
451 public void setTaxonomicNames(List<TaxonNameBase> value) {
452 this.taxonomicNames = value;
453 }
454
455 /**
456 * Gets the value of the references property.
457 *
458 * @return
459 * possible object is
460 * {@link List<SpecimenOrObservationBase> }
461 *
462 */
463 public List<SpecimenOrObservationBase> getOccurrences() {
464 return occurrences;
465 }
466
467 /**
468 * Sets the value of the references property.
469 *
470 * @param value
471 * allowed object is
472 * {@link List<SpecimenOrObservationBase> }
473 *
474 */
475 public void setOccurrences(List<SpecimenOrObservationBase> value) {
476 this.occurrences = value;
477 }
478
479 /**
480 * Gets the value of the references property.
481 *
482 * @return
483 * possible object is
484 * {@link List<ReferenceBase> }
485 *
486 */
487 public List<ReferenceBase> getReferences() {
488 return references;
489 }
490
491 /**
492 * Sets the value of the references property.
493 *
494 * @param value
495 * allowed object is
496 * {@link List<ReferenceBase> }
497 *
498 */
499 public void setReferences(List<ReferenceBase> value) {
500 this.references = value;
501 }
502
503 /**
504 * Adds the referenced entities in value to the referenced entity property list.
505 *
506 * @param value
507 * allowed object is
508 * {@link Collection<ReferencedEntityBase> }
509 *
510 */
511 public <T extends ReferencedEntityBase> void addReferencedEntities(Collection<T> value) {
512 for (T referencedEntity: value) {
513 this.referencedEntities.add(referencedEntity);
514 }
515 }
516
517 /**
518 * Gets the value of the property.
519 *
520 * @return
521 * possible object is
522 * {@link List<ReferencedEntityBase> }
523 *
524 */
525 public List<ReferencedEntityBase> getReferencedEntities() {
526 return referencedEntities;
527 }
528
529 /**
530 * Sets the value of the referencedEntities property.
531 *
532 * @param value
533 * allowed object is
534 * {@link List<ReferencedEntityBase> }
535 *
536 */
537 public void setReferencedEntities(List<? extends ReferencedEntityBase> value) {
538 this.referencedEntities = new ArrayList<ReferencedEntityBase>();
539 referencedEntities.addAll(value);
540 }
541
542 /**
543 * Adds the features in value to the feature data property list.
544 *
545 * @param value
546 * allowed object is
547 * {@link Collection<VersionableEntity> }
548 *
549 */
550 public <T extends VersionableEntity> void addFeatureData(Collection<T> value) {
551 for (T featureItem: value) {
552 this.featureData.add(featureItem);
553 }
554 }
555
556 /**
557 * Gets the value of the feature data property.
558 *
559 * @return
560 * possible object is
561 * {@link List<VersionableEntity> }
562 *
563 */
564 // public List<VersionableEntity> getFeatureData() {
565 public List<VersionableEntity> getFeatureData() {
566 return featureData;
567 }
568
569 /**
570 * Sets the value of the feature data property.
571 *
572 * @param value
573 * allowed object is
574 * {@link List<VersionableEntity> }
575 *
576 */
577 public <T extends VersionableEntity> void setFeatureData(List<T> value) {
578 featureData = new ArrayList<VersionableEntity>();
579 for (T featureItem: value) {
580 this.featureData.add(featureItem);
581 }
582 }
583
584 // public void setFeatureData(List<? extends VersionableEntity> value) {
585 //public void setFeatureData(List<? extends VersionableEntity<?>> value) {
586 // this.featureData = new ArrayList<VersionableEntity>();
587 // this.featureData = new ArrayList<VersionableEntity<?>>();
588 // featureData.addAll(value);
589 //}
590
591 /**
592 * Adds the features in value to the language data property list.
593 *
594 * @param value
595 * allowed object is
596 * {@link Collection<LanguageStringBase> }
597 *
598 */
599 public <T extends LanguageStringBase> void addLanguageData(Collection<T> value) {
600 for (T languageItem: value) {
601 this.languageData.add(languageItem);
602 }
603 }
604
605 /**
606 * Gets the value of the language data property.
607 *
608 * @return
609 * possible object is
610 * {@link List<LanguageStringBase> }
611 *
612 */
613 public List<LanguageStringBase> getLanguageData() {
614 return languageData;
615 }
616
617 /**
618 * Sets the value of the feature data property.
619 *
620 * @param value
621 * allowed object is
622 * {@link List<LanguageStringBase> }
623 *
624 */
625 public void setLanguageData(List<? extends LanguageStringBase> value) {
626 this.languageData = new ArrayList<LanguageStringBase>();
627 languageData.addAll(value);
628 }
629
630 /**
631 * Adds the taxa in value to the taxa property list.
632 *
633 * @param value
634 * allowed object is
635 * {@link Collection<Taxon> }
636 *
637 */
638 public void addTaxa(Collection<Taxon> value) {
639 for (Taxon taxon: value) {
640 this.taxa.add(taxon);
641 }
642 }
643
644 /**
645 * Gets the value of the taxa property.
646 *
647 * @return
648 * possible object is
649 * {@link List<Taxon> }
650 *
651 */
652 // public List<Taxon> getTaxa() {
653 // return taxa;
654 // }
655
656 /**
657 * Gets the value of the taxa property as {@link Collection<TaxonBase> }
658 *
659 * @return
660 * possible object is
661 * {@link Collection<TaxonBase> }
662 *
663 */
664 public Collection<? extends TaxonBase> getTaxa() {
665
666 //TODO can be deleted when everything works
667 //Object obj = taxa;
668 //Collection<TaxonBase> taxonBases = (Collection<TaxonBase>)obj;
669 List<Taxon> list = taxa;
670 return list;
671 }
672
673 public Collection<TaxonBase> getTaxonBases() {
674
675 Collection<TaxonBase> result = new HashSet<TaxonBase>();;
676 if (taxa != null) {
677 result.addAll(taxa);
678 }
679 if (synonyms != null) {
680 result.addAll(synonyms);
681 }
682 return result;
683 }
684
685 /**
686 * Sets the value of the taxa property.
687 *
688 * @param value
689 * allowed object is
690 * {@link List<Taxon> }
691 *
692 */
693 public void setTaxa(List<Taxon> value) {
694 this.taxa = value;
695 }
696
697 /**
698 * Adds the taxon in value to the taxa property list.
699 *
700 * @param value
701 *
702 */
703 public void addTaxon(Taxon value) {
704 this.taxa.add(value);
705 }
706
707
708 /**
709 * Gets the value of the synonyms property.
710 *
711 * @return
712 * possible object is
713 * {@link List<Synonym> }
714 *
715 */
716 public List<Synonym> getSynonyms() {
717 return synonyms;
718 }
719
720 /**
721 * Sets the value of the synonyms property.
722 *
723 * @param value
724 * allowed object is
725 * {@link List<Synonym> }
726 *
727 */
728 public void setSynonyms(List<Synonym> value) {
729 this.synonyms = value;
730 }
731
732 /**
733 * Adds the synonym in value to the taxa property list.
734 *
735 * @param value
736 *
737 */
738 public void addSynonym(Synonym value) {
739 this.synonyms.add(value);
740 }
741
742 /**
743 * Adds the synonym in value to the synonyms property list.
744 *
745 * @param value
746 * allowed object is
747 * {@link Collection<Synonym> }
748 *
749 */
750 public void addSynonyms(Collection<Synonym> value) {
751 for (Synonym synonym: value) {
752 this.synonyms.add(synonym);
753 }
754 }
755
756 /**
757 * Gets the value of the relationships property.
758 *
759 * @return
760 * possible object is
761 * {@link Set<RelationshipBase> }
762 *
763 */
764 public Set<RelationshipBase> getRelationships() {
765 return relationships;
766 }
767
768 /**
769 * Sets the value of the relationships property.
770 *
771 * @param value
772 * allowed object is
773 * {@link Set<RelationshipBase> }
774 *
775 */
776 public void setRelationships(Set<RelationshipBase> value) {
777 this.relationships = value;
778 }
779
780 /**
781 * Adds the relationship in value to the relationships property list.
782 *
783 * @param value
784 * allowed object is
785 * {@link Collection<RelationshipBase> }
786 *
787 */
788 public void addRelationships(Collection<? extends RelationshipBase> value) {
789 for (RelationshipBase relationship: value) {
790 this.relationships.add(relationship);
791 }
792 }
793
794 /**
795 * Adds the media in value to the media property list.
796 *
797 * @param value
798 * allowed object is
799 * {@link Collection<VersionableEntity> }
800 *
801 */
802 public <T extends Media> void addMedia(Collection<T> value) {
803 for (T medium: value) {
804 this.media.add(medium);
805 }
806 }
807
808 /**
809 * Gets the value of the property.
810 *
811 * @return
812 * possible object is
813 * {@link List<ReferencedEntityBase> }
814 *
815 */
816 public List<Media> getMedia() {
817 return media;
818 }
819
820 /**
821 * Sets the value of the referencedEntities property.
822 *
823 * @param value
824 * allowed object is
825 * {@link List<ReferencedEntityBase> }
826 *
827 */
828 public void setMedia(List<Media> value) {
829 this.media = new ArrayList<Media>();
830 media.addAll(value);
831 }
832
833 /**
834 * Gets the value of the synonyms property.
835 *
836 * @return
837 * possible object is
838 * {@link List<Synonym> }
839 *
840 */
841 public List<HomotypicalGroup> getHomotypicalGroups() {
842 return homotypicalGroups;
843 }
844
845 /**
846 * Sets the value of the synonyms property.
847 *
848 * @param value
849 * allowed object is
850 * {@link List<Synonym> }
851 *
852 */
853 public void setHomotypicalGroups(List<HomotypicalGroup> value) {
854 this.homotypicalGroups = value;
855 }
856
857 }