Revision 9691cba9
Added by Andreas Müller over 3 years ago
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/dto/tdwg/voc/TaxonConcept.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2007 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
... | ... | |
39 | 39 |
|
40 | 40 |
@XmlElement(namespace = "http://rs.tdwg.org/ontology/voc/TaxonConcept#") |
41 | 41 |
private AccordingTo accordingTo; |
42 |
|
|
42 |
|
|
43 | 43 |
@XmlElement(name = "hasName", namespace = "http://rs.tdwg.org/ontology/voc/TaxonConcept#") |
44 | 44 |
private HasName hasName; |
45 |
|
|
45 |
|
|
46 | 46 |
@XmlElement(name = "hasRelationship", namespace = "http://rs.tdwg.org/ontology/voc/TaxonConcept#") |
47 | 47 |
private Set<HasRelationship> hasRelationships = null; |
48 |
|
|
48 |
|
|
49 | 49 |
@XmlElement(name = "describedBy", namespace = "http://rs.tdwg.org/ontology/voc/TaxonConcept#") |
50 | 50 |
private Set<DescribedBy> describedBys = null; |
51 |
|
|
51 |
|
|
52 | 52 |
public Set<Relationship> getHasRelationship() { |
53 | 53 |
if(hasRelationships != null) { |
54 | 54 |
Set<Relationship> relationships = new HashSet<Relationship>(); |
... | ... | |
63 | 63 |
|
64 | 64 |
public void setHasRelationship(Set<Relationship> relationships) { |
65 | 65 |
if(relationships != null) { |
66 |
this.hasRelationships = new HashSet<HasRelationship>();
|
|
66 |
this.hasRelationships = new HashSet<>(); |
|
67 | 67 |
for(Relationship relationship : relationships) { |
68 | 68 |
hasRelationships.add( new HasRelationship(relationship)); |
69 | 69 |
} |
... | ... | |
71 | 71 |
hasRelationships = null; |
72 | 72 |
} |
73 | 73 |
} |
74 |
|
|
74 |
|
|
75 | 75 |
public Set<SpeciesProfileModel> getDescribedBy() { |
76 | 76 |
if(describedBys != null) { |
77 |
Set<SpeciesProfileModel> speciesProfileModels = new HashSet<SpeciesProfileModel>();
|
|
77 |
Set<SpeciesProfileModel> speciesProfileModels = new HashSet<>(); |
|
78 | 78 |
for(DescribedBy describedBy : describedBys) { |
79 | 79 |
speciesProfileModels.add(describedBy.getSpeciesProfileModel()); |
80 | 80 |
} |
... | ... | |
102 | 102 |
public void setHasName(TaxonName taxonName) { |
103 | 103 |
this.hasName = new HasName(taxonName, false); |
104 | 104 |
} |
105 |
|
|
105 |
|
|
106 | 106 |
public TaxonName getHasNameRelation() { |
107 | 107 |
return hasName != null ? hasName.getTaxonName() : null; |
108 | 108 |
} |
... | ... | |
114 | 114 |
public Boolean isPrimary() { |
115 | 115 |
return primary; |
116 | 116 |
} |
117 |
|
|
117 |
|
|
118 | 118 |
public Actor getAccordingTo() { |
119 | 119 |
return accordingTo != null ? accordingTo.getActor() : null; |
120 | 120 |
} |
... | ... | |
122 | 122 |
public void setAccordingTo(Actor accordingTo) { |
123 | 123 |
this.accordingTo = new AccordingTo(accordingTo, false); |
124 | 124 |
} |
125 |
|
|
125 |
|
|
126 | 126 |
public Actor getAccordingToRelation() { |
127 | 127 |
return accordingTo != null ? accordingTo.getActor() : null; |
128 | 128 |
} |
... | ... | |
134 | 134 |
public void setPrimary(Boolean primary) { |
135 | 135 |
this.primary = primary; |
136 | 136 |
} |
137 |
|
|
137 |
|
|
138 | 138 |
@XmlAccessorType(XmlAccessType.FIELD) |
139 | 139 |
@XmlType(name = "HasName", propOrder = { |
140 | 140 |
"taxonName" |
... | ... | |
142 | 142 |
public static class HasName extends LinkType { |
143 | 143 |
@XmlElement(name = "TaxonName", namespace = "http://rs.tdwg.org/ontology/voc/TaxonName#") |
144 | 144 |
private TaxonName taxonName; |
145 |
|
|
145 |
|
|
146 | 146 |
protected HasName() {} |
147 |
|
|
147 |
|
|
148 | 148 |
protected HasName(TaxonName taxonName, boolean useRelation) { |
149 | 149 |
if(useRelation) { |
150 | 150 |
if(taxonName != null && taxonName.getIdentifier() != null) { |
... | ... | |
165 | 165 |
this.taxonName = taxonName; |
166 | 166 |
} |
167 | 167 |
} |
168 |
|
|
168 |
|
|
169 | 169 |
@XmlAccessorType(XmlAccessType.FIELD) |
170 | 170 |
@XmlType(name = "HasRelationship", propOrder = { |
171 | 171 |
"relationship" |
... | ... | |
174 | 174 |
|
175 | 175 |
@XmlElement(name = "Relationship", namespace = "http://rs.tdwg.org/ontology/voc/TaxonConcept#") |
176 | 176 |
private Relationship relationship; |
177 |
|
|
177 |
|
|
178 | 178 |
public HasRelationship() {} |
179 |
|
|
179 |
|
|
180 | 180 |
public HasRelationship(Relationship relationship) { |
181 | 181 |
this.relationship = relationship; |
182 | 182 |
} |
183 |
|
|
183 |
|
|
184 | 184 |
public Relationship getRelationship() { |
185 | 185 |
return relationship; |
186 | 186 |
} |
... | ... | |
189 | 189 |
this.relationship = relationship; |
190 | 190 |
} |
191 | 191 |
} |
192 |
|
|
192 |
|
|
193 | 193 |
@XmlAccessorType(XmlAccessType.FIELD) |
194 | 194 |
@XmlType(name = "AccordingTo", propOrder = { |
195 | 195 |
"actor" |
... | ... | |
201 | 201 |
@XmlElement(name = "Team", namespace = "http://rs.tdwg.org/ontology/voc/Team#", type = Team.class) |
202 | 202 |
}) |
203 | 203 |
private Actor actor; |
204 |
|
|
204 |
|
|
205 | 205 |
protected AccordingTo() {} |
206 |
|
|
206 |
|
|
207 | 207 |
protected AccordingTo(Actor actor, boolean useRelation) { |
208 | 208 |
if(useRelation) { |
209 | 209 |
if(actor != null && actor.getIdentifier() != null) { |
... | ... | |
215 | 215 |
this.actor = actor; |
216 | 216 |
} |
217 | 217 |
} |
218 |
|
|
218 |
|
|
219 | 219 |
protected Actor getActor() { |
220 | 220 |
return actor; |
221 | 221 |
} |
... | ... | |
224 | 224 |
this.actor = actor; |
225 | 225 |
} |
226 | 226 |
} |
227 |
|
|
227 |
|
|
228 | 228 |
@XmlAccessorType(XmlAccessType.FIELD) |
229 | 229 |
@XmlType(name = "DescribedBy", propOrder = { |
230 | 230 |
"speciesProfileModel" |
... | ... | |
233 | 233 |
|
234 | 234 |
@XmlElement(name = "SpeciesProfileModel", namespace = "http://rs.tdwg.org/ontology/voc/SpeciesProfileModel#") |
235 | 235 |
private SpeciesProfileModel speciesProfileModel; |
236 |
|
|
236 |
|
|
237 | 237 |
protected DescribedBy() {} |
238 |
|
|
238 |
|
|
239 | 239 |
protected DescribedBy(SpeciesProfileModel speciesProfileModel) { |
240 | 240 |
this.speciesProfileModel = speciesProfileModel; |
241 | 241 |
} |
242 |
|
|
242 |
|
|
243 | 243 |
protected SpeciesProfileModel getSpeciesProfileModel() { |
244 | 244 |
return speciesProfileModel; |
245 | 245 |
} |
... | ... | |
249 | 249 |
} |
250 | 250 |
} |
251 | 251 |
|
252 |
public Object onCycleDetected(Context context) { |
|
252 |
@Override |
|
253 |
public Object onCycleDetected(Context context) { |
|
253 | 254 |
TaxonConcept taxonConcept = new TaxonConcept(); |
254 | 255 |
taxonConcept.setIdentifier(super.getIdentifier()); |
255 | 256 |
taxonConcept.setTitle(super.getTitle()); |
Also available in: Unified diff
cleanup