View Javadoc

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