Revision 9691cba9
Added by Andreas Müller over 3 years ago
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/dto/tdwg/voc/InfoItem.java | ||
---|---|---|
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 |
*/ |
|
1 | 9 |
package eu.etaxonomy.cdm.remote.dto.tdwg.voc; |
2 | 10 |
|
3 | 11 |
import java.util.HashMap; |
... | ... | |
27 | 35 |
}) |
28 | 36 |
@XmlRootElement(name = "InfoItem", namespace = "http://rs.tdwg.org/ontology/voc/SpeciesProfileModel#") |
29 | 37 |
public class InfoItem extends Description { |
30 |
|
|
38 |
|
|
31 | 39 |
@XmlElement(name = "associatedTaxon", namespace = "http://rs.tdwg.org/ontology/voc/SpeciesProfileModel#") |
32 | 40 |
private AssociatedTaxon associatedTaxon; |
33 |
|
|
41 |
|
|
34 | 42 |
@XmlElement(name = "category", namespace = "http://rs.tdwg.org/ontology/voc/SpeciesProfileModel#") |
35 | 43 |
private DefinedTermLinkType category; |
36 |
|
|
44 |
|
|
37 | 45 |
@XmlElement(name = "context", namespace = "http://rs.tdwg.org/ontology/voc/SpeciesProfileModel#") |
38 | 46 |
private Set<StringType> context; |
39 |
|
|
47 |
|
|
40 | 48 |
@XmlElement(name = "hasContent", namespace = "http://rs.tdwg.org/ontology/voc/SpeciesProfileModel#") |
41 | 49 |
private Set<StringType> hasContent; |
42 |
|
|
50 |
|
|
43 | 51 |
@XmlElement(name = "contextValue", namespace = "http://rs.tdwg.org/ontology/voc/SpeciesProfileModel#") |
44 | 52 |
private Set<DefinedTermLinkType> contextValues = null; |
45 |
|
|
53 |
|
|
46 | 54 |
@XmlElement(name = "hasValue", namespace = "http://rs.tdwg.org/ontology/voc/SpeciesProfileModel#") |
47 | 55 |
private Set<DefinedTermLinkType> hasValues = null; |
48 |
|
|
56 |
|
|
49 | 57 |
public TaxonConcept getAssociatedTaxon() { |
50 | 58 |
return associatedTaxon != null ? associatedTaxon.getTaxonConcept() : null; |
51 | 59 |
} |
... | ... | |
53 | 61 |
public void setAssociatedTaxon(TaxonConcept taxonConcept) { |
54 | 62 |
this.associatedTaxon = new AssociatedTaxon(taxonConcept, false); |
55 | 63 |
} |
56 |
|
|
64 |
|
|
57 | 65 |
public TaxonConcept getAssocatedTaxonRelation() { |
58 | 66 |
return associatedTaxon != null ? associatedTaxon.getTaxonConcept() : null; |
59 | 67 |
} |
... | ... | |
61 | 69 |
public void setAssociatedTaxonRelation(TaxonConcept taxonConcept) { |
62 | 70 |
this.associatedTaxon = new AssociatedTaxon(taxonConcept, true); |
63 | 71 |
} |
64 |
|
|
72 |
|
|
65 | 73 |
public Map<Object,StringType> getContext() { |
66 | 74 |
if(context != null) { |
67 | 75 |
Map<Object,StringType> contextMap = new HashMap<Object,StringType>(); |
... | ... | |
103 | 111 |
this.hasContent = null; |
104 | 112 |
} |
105 | 113 |
} |
106 |
|
|
114 |
|
|
107 | 115 |
public DefinedTerm getCategory() { |
108 | 116 |
return category != null ? category.getDefinedTerm() : null; |
109 | 117 |
} |
... | ... | |
111 | 119 |
public void setCategory(DefinedTerm definedTerm) { |
112 | 120 |
this.category = new DefinedTermLinkType(definedTerm, false); |
113 | 121 |
} |
114 |
|
|
122 |
|
|
115 | 123 |
public DefinedTerm getCategoryRelation() { |
116 | 124 |
return category != null ? category.getDefinedTerm() : null; |
117 | 125 |
} |
... | ... | |
119 | 127 |
public void setCategoryRelation(DefinedTerm definedTerm) { |
120 | 128 |
this.category = new DefinedTermLinkType(definedTerm, true); |
121 | 129 |
} |
122 |
|
|
130 |
|
|
123 | 131 |
public Set<DefinedTerm> getContextValue() { |
124 | 132 |
if(contextValues != null) { |
125 | 133 |
Set<DefinedTerm> definedTerms = new HashSet<DefinedTerm>(); |
... | ... | |
142 | 150 |
contextValues = null; |
143 | 151 |
} |
144 | 152 |
} |
145 |
|
|
153 |
|
|
146 | 154 |
public DefinedTerm getSingleContextValue() { |
147 | 155 |
if(contextValues != null) { |
148 | 156 |
DefinedTerm definedTerm = null; |
... | ... | |
163 | 171 |
contextValues = null; |
164 | 172 |
} |
165 | 173 |
} |
166 |
|
|
174 |
|
|
167 | 175 |
public Set<DefinedTerm> getHasValue() { |
168 | 176 |
if(hasValues != null) { |
169 | 177 |
Set<DefinedTerm> definedTerms = new HashSet<DefinedTerm>(); |
... | ... | |
186 | 194 |
hasValues = null; |
187 | 195 |
} |
188 | 196 |
} |
189 |
|
|
197 |
|
|
190 | 198 |
public DefinedTerm getHasSingleValue() { |
191 | 199 |
if(hasValues != null) { |
192 | 200 |
DefinedTerm definedTerm = null; |
... | ... | |
201 | 209 |
|
202 | 210 |
public void setHasSingleValue(DefinedTerm definedTerm) { |
203 | 211 |
if(definedTerm != null) { |
204 |
this.hasValues = new HashSet<DefinedTermLinkType>();
|
|
212 |
this.hasValues = new HashSet<DefinedTermLinkType>(); |
|
205 | 213 |
hasValues.add( new DefinedTermLinkType(definedTerm,false)); |
206 | 214 |
} else { |
207 | 215 |
hasValues = null; |
... | ... | |
215 | 223 |
public static class AssociatedTaxon extends LinkType { |
216 | 224 |
@XmlElement(name = "TaxonConcept", namespace = "http://rs.tdwg.org/ontology/voc/TaxonConcept#") |
217 | 225 |
private TaxonConcept taxonConcept; |
218 |
|
|
226 |
|
|
219 | 227 |
protected AssociatedTaxon() {} |
220 |
|
|
228 |
|
|
221 | 229 |
protected AssociatedTaxon(TaxonConcept taxonConcept, boolean useRelation) { |
222 | 230 |
if(useRelation) { |
223 | 231 |
if(taxonConcept != null && taxonConcept.getIdentifier() != null) { |
... | ... | |
238 | 246 |
this.taxonConcept = taxonConcept; |
239 | 247 |
} |
240 | 248 |
} |
241 |
|
|
249 |
|
|
242 | 250 |
@XmlAccessorType(XmlAccessType.FIELD) |
243 | 251 |
@XmlType(name = "DefinedTermLinkType", propOrder = { |
244 | 252 |
"definedTerm" |
... | ... | |
249 | 257 |
@XmlElement(name = "GeographicRegion", namespace = "http://rs.tdwg.org/ontology/voc/GeographicRegion#", type = GeographicRegion.class) |
250 | 258 |
}) |
251 | 259 |
private DefinedTerm definedTerm; |
252 |
|
|
260 |
|
|
253 | 261 |
protected DefinedTermLinkType() {} |
254 |
|
|
262 |
|
|
255 | 263 |
protected DefinedTermLinkType(DefinedTerm definedTerm, boolean useRelation) { |
256 | 264 |
if(useRelation) { |
257 | 265 |
if(definedTerm != null && definedTerm.getIdentifier() != null) { |
Also available in: Unified diff
cleanup