Revision 0ecfd682
Added by Andreas Müller almost 8 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/DescriptionElementBase.java | ||
---|---|---|
181 | 181 |
this.feature = feature; |
182 | 182 |
} |
183 | 183 |
|
184 |
// ******************** GETTER / SETTER ***********************************/ |
|
185 |
|
|
184 | 186 |
/** |
185 | 187 |
* Returns the list of {@link Media media} (that is pictures, movies, |
186 | 188 |
* recorded sounds ...) <i>this</i> description element is based on. |
... | ... | |
395 | 397 |
return this.sources; |
396 | 398 |
} |
397 | 399 |
|
398 |
/* (non-Javadoc) |
|
399 |
* @see eu.etaxonomy.cdm.model.common.ISourceable#addSource(eu.etaxonomy.cdm.model.common.IOriginalSource) |
|
400 |
*/ |
|
401 | 400 |
@Override |
402 | 401 |
public void addSource(DescriptionElementSource source) { |
403 | 402 |
if (source != null){ |
404 |
DescriptionElementBase oldSourcedObj = source.getSourcedObj(); |
|
405 |
if (oldSourcedObj != null && oldSourcedObj != this){ |
|
406 |
oldSourcedObj.getSources().remove(source); |
|
407 |
} |
|
408 | 403 |
this.sources.add(source); |
409 |
source.setSourcedObj(this); |
|
410 | 404 |
} |
411 | 405 |
} |
412 | 406 |
|
413 |
/* (non-Javadoc) |
|
414 |
* @see eu.etaxonomy.cdm.model.common.ISourceable#addSource(eu.etaxonomy.cdm.model.common.OriginalSourceType, java.lang.String, java.lang.String, eu.etaxonomy.cdm.model.reference.Reference, java.lang.String) |
|
415 |
*/ |
|
416 | 407 |
@Override |
417 | 408 |
public DescriptionElementSource addSource(OriginalSourceType type, String id, String idNamespace, Reference citation, String microCitation) { |
418 | 409 |
if (id == null && idNamespace == null && citation == null && microCitation == null){ |
... | ... | |
429 | 420 |
} |
430 | 421 |
} |
431 | 422 |
|
432 |
|
|
433 |
/* (non-Javadoc) |
|
434 |
* @see eu.etaxonomy.cdm.model.common.ISourceable#addImportSource(java.lang.String, java.lang.String, eu.etaxonomy.cdm.model.reference.Reference, java.lang.String) |
|
435 |
*/ |
|
436 | 423 |
@Override |
437 | 424 |
public DescriptionElementSource addImportSource(String id, String idNamespace, Reference<?> citation, String microCitation) { |
438 | 425 |
if (id == null && idNamespace == null && citation == null && microCitation == null){ |
... | ... | |
458 | 445 |
addSource(newSource); |
459 | 446 |
} |
460 | 447 |
|
461 |
/* (non-Javadoc) |
|
462 |
* @see eu.etaxonomy.cdm.model.common.ISourceable#removeSource(eu.etaxonomy.cdm.model.common.IOriginalSource) |
|
463 |
*/ |
|
464 | 448 |
@Override |
465 | 449 |
public void removeSource(DescriptionElementSource source) { |
466 | 450 |
this.sources.remove(source); |
Also available in: Unified diff
Remove bidirectionality for supplemental data #5743