update factory methods for original sources #1549
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / common / ISourceable.java
1 /**
2 * Copyright (C) 2009 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.model.common;
11
12 import java.util.Set;
13
14 import eu.etaxonomy.cdm.model.reference.Reference;
15
16
17 public interface ISourceable<T extends IOriginalSource> {
18
19 /**
20 * Returns the set of original sources (citations) for this sourceable object
21 * @return
22 */
23 public Set<T> getSources();
24
25 /**
26 * Adds a source to this object
27 * @param source
28 */
29 public void addSource(T source);
30
31
32 /**
33 * Adds a source that is newly created by its components. If all components except for the
34 * type are <code>null</null>
35 * no source is added.
36 * @param type the {@link OriginalSourceType type} of the source
37 * @param idInSource the id used in the source
38 * @param idNamespace the namespace for the id in the source
39 * @param citation the source as a {@link Reference reference}
40 * @param microReference the details (e.g. page number) in the reference
41 */
42 public T addSource(OriginalSourceType type, String id, String idNamespace, Reference citation, String microCitation);
43
44
45 /**
46 * Removes a source from this object
47 * @param source
48 */
49 public void removeSource(T source);
50
51 /**
52 * Adds a {@link IOriginalSource source} of {@link OriginalSourceType type} Import to this description element.
53 *
54 * @param idInSource the id used in the source
55 * @param idNamespace the namespace for the id in the source
56 * @param citation the source as a {@link Reference reference}
57 * @param microReference the details (e.g. page number) in the reference
58 * @param nameUsedInSource the taxon name used in the source
59 * @param originalNameString the name as text used in the source
60 */
61 public T addImportSource(String id, String idNamespace, Reference<?> citation, String microCitation);
62
63 }