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