1 |
8d69ef60
|
Andreas Müller
|
/**
|
2 |
|
|
* Copyright (C) 2007 EDIT
|
3 |
13b550a3
|
Andreas Kohlbecker
|
* European Distributed Institute of Taxonomy
|
4 |
8d69ef60
|
Andreas Müller
|
* http://www.e-taxonomy.eu
|
5 |
13b550a3
|
Andreas Kohlbecker
|
*
|
6 |
8d69ef60
|
Andreas Müller
|
* 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 |
788ff862
|
Andreas Müller
|
package eu.etaxonomy.cdm.model.common;
|
11 |
|
|
|
12 |
db45aff9
|
Andreas Müller
|
import java.util.List;
|
13 |
788ff862
|
Andreas Müller
|
import java.util.Set;
|
14 |
|
|
|
15 |
|
|
import eu.etaxonomy.cdm.model.media.Rights;
|
16 |
|
|
|
17 |
cb727e1a
|
n.hoffmann
|
public interface IIdentifiableEntity extends ISourceable<IdentifiableSource>, IAnnotatableEntity{
|
18 |
788ff862
|
Andreas Müller
|
|
19 |
13b550a3
|
Andreas Kohlbecker
|
public LSID getLsid();
|
20 |
788ff862
|
Andreas Müller
|
|
21 |
13b550a3
|
Andreas Kohlbecker
|
public void setLsid(LSID lsid);
|
22 |
788ff862
|
Andreas Müller
|
|
23 |
13b550a3
|
Andreas Kohlbecker
|
public String generateTitle();
|
24 |
788ff862
|
Andreas Müller
|
|
25 |
13b550a3
|
Andreas Kohlbecker
|
public String getTitleCache();
|
26 |
788ff862
|
Andreas Müller
|
|
27 |
13b550a3
|
Andreas Kohlbecker
|
/**
|
28 |
87cab9c5
|
Andreas Müller
|
* Sets the title cache without changing the <code>protectCache</code> flag.<BR><BR>
|
29 |
503e6c4e
|
Patric Plitzner
|
* NOTE: Use with care. If this flag is <code>false</code> the <code>titleCache</code> may be
|
30 |
87cab9c5
|
Andreas Müller
|
* recomputed with the next call of {@link #getTitleCache()}, which is automatically the case when
|
31 |
|
|
* the object is persisted.
|
32 |
13b550a3
|
Andreas Kohlbecker
|
* @see #setTitleCache(String, boolean)
|
33 |
b606df4d
|
Andreas Müller
|
* @see #getTitleCache()
|
34 |
13b550a3
|
Andreas Kohlbecker
|
* @param titleCache
|
35 |
7c01e338
|
Andreas Müller
|
* @deprecated this method only exists to be in line with the Java Beans Specification (JSR 220 or JSR 273) .
|
36 |
87cab9c5
|
Andreas Müller
|
* As it will set the {@link #isProtectedTitleCache() protected} flag to false the title cache value
|
37 |
503e6c4e
|
Patric Plitzner
|
* may be automatically recomputed later. There are only very rare use cases were a programmer may
|
38 |
87cab9c5
|
Andreas Müller
|
* want to use this method directly.
|
39 |
|
|
* Better use {@link #setTitleCache(String, boolean)} with second parameter <code>protectCache</code>
|
40 |
|
|
* set to <code>true</code>.
|
41 |
13b550a3
|
Andreas Kohlbecker
|
*/
|
42 |
87cab9c5
|
Andreas Müller
|
@Deprecated
|
43 |
13b550a3
|
Andreas Kohlbecker
|
public void setTitleCache(String titleCache);
|
44 |
788ff862
|
Andreas Müller
|
|
45 |
87cab9c5
|
Andreas Müller
|
/**
|
46 |
|
|
* Sets the title cache.<BR>
|
47 |
|
|
* NOTE: In most cases the <code>protectCache</code> argument should be set to <code>true</code>.
|
48 |
|
|
* See comments at {@link #setTitleCache(String)}
|
49 |
503e6c4e
|
Patric Plitzner
|
*
|
50 |
87cab9c5
|
Andreas Müller
|
* @param titleCache the new title cache
|
51 |
|
|
* @param protectCache the protect flag, <b>should in most cases be set to <code>true</code></b>
|
52 |
|
|
*/
|
53 |
13b550a3
|
Andreas Kohlbecker
|
public void setTitleCache(String titleCache, boolean protectCache);
|
54 |
788ff862
|
Andreas Müller
|
|
55 |
87cab9c5
|
Andreas Müller
|
public boolean isProtectedTitleCache();
|
56 |
|
|
|
57 |
|
|
public void setProtectedTitleCache(boolean protectedTitleCache);
|
58 |
503e6c4e
|
Patric Plitzner
|
|
59 |
13b550a3
|
Andreas Kohlbecker
|
public Set<Rights> getRights();
|
60 |
788ff862
|
Andreas Müller
|
|
61 |
13b550a3
|
Andreas Kohlbecker
|
public void addRights(Rights right);
|
62 |
788ff862
|
Andreas Müller
|
|
63 |
13b550a3
|
Andreas Kohlbecker
|
public void removeRights(Rights right);
|
64 |
788ff862
|
Andreas Müller
|
|
65 |
13b550a3
|
Andreas Kohlbecker
|
public List<Credit> getCredits();
|
66 |
db45aff9
|
Andreas Müller
|
|
67 |
13b550a3
|
Andreas Kohlbecker
|
public Credit getCredits(Integer index);
|
68 |
db45aff9
|
Andreas Müller
|
|
69 |
13b550a3
|
Andreas Kohlbecker
|
public void addCredit(Credit credig);
|
70 |
db45aff9
|
Andreas Müller
|
|
71 |
13b550a3
|
Andreas Kohlbecker
|
public void addCredit(Credit credit, int index);
|
72 |
db45aff9
|
Andreas Müller
|
|
73 |
13b550a3
|
Andreas Kohlbecker
|
public void removeCredit(Credit credit);
|
74 |
788ff862
|
Andreas Müller
|
|
75 |
13b550a3
|
Andreas Kohlbecker
|
public void removeCredit(int index);
|
76 |
788ff862
|
Andreas Müller
|
|
77 |
13b550a3
|
Andreas Kohlbecker
|
public Set<Extension> getExtensions();
|
78 |
788ff862
|
Andreas Müller
|
|
79 |
13b550a3
|
Andreas Kohlbecker
|
public void addExtension(Extension extension);
|
80 |
788ff862
|
Andreas Müller
|
|
81 |
13b550a3
|
Andreas Kohlbecker
|
public void removeExtension(Extension extension);
|
82 |
788ff862
|
Andreas Müller
|
|
83 |
8678bd8d
|
Andreas Müller
|
/**
|
84 |
|
|
* Returns the list of {@link Identifier alternative identifiers}.
|
85 |
|
|
* In case the order of these identifiers is important it should be
|
86 |
|
|
* implemented such that the first item in the list is the most
|
87 |
|
|
* important/most current identifier. <BR>
|
88 |
|
|
* E.g. if a barcode identifier
|
89 |
|
|
* is more important than the accession number for a certain
|
90 |
|
|
* specimen, than the barcode identifier should be before the accession number.
|
91 |
|
|
* <BR>Or if a sample designation is the most recent of all sample designations
|
92 |
|
|
* than it should be the first in the list while all history designations come
|
93 |
|
|
* later.
|
94 |
|
|
* @return
|
95 |
|
|
*/
|
96 |
c2f9bfc4
|
Andreas Müller
|
public List<Identifier> getIdentifiers();
|
97 |
5b99edea
|
Patric Plitzner
|
|
98 |
16552d3b
|
Andreas Müller
|
/**
|
99 |
|
|
* Create and add a new identifier.
|
100 |
|
|
* @see #getIdentifiers()
|
101 |
|
|
* @param identifier
|
102 |
|
|
* @param identifierType
|
103 |
|
|
* @return
|
104 |
|
|
*/
|
105 |
|
|
public Identifier addIdentifier(String identifier, DefinedTerm identifierType);
|
106 |
|
|
|
107 |
8678bd8d
|
Andreas Müller
|
/**
|
108 |
|
|
* @see #getIdentifiers()
|
109 |
|
|
* @param identifier
|
110 |
|
|
*/
|
111 |
5b99edea
|
Patric Plitzner
|
public void addIdentifier(Identifier identifier);
|
112 |
8678bd8d
|
Andreas Müller
|
|
113 |
|
|
/**
|
114 |
|
|
* Adds an identifier at the given position. For use of
|
115 |
|
|
* <code>index</code> see {@link List#add(int, Object)} and {@link#getIdentifiers()}
|
116 |
16552d3b
|
Andreas Müller
|
* @see #getIdentifiers()
|
117 |
8678bd8d
|
Andreas Müller
|
* @param index the list index
|
118 |
|
|
* @param identifier the identifier
|
119 |
|
|
*/
|
120 |
|
|
public void addIdentifier(int index, Identifier identifier);
|
121 |
5b99edea
|
Patric Plitzner
|
|
122 |
8678bd8d
|
Andreas Müller
|
/**
|
123 |
|
|
* Removes an identifier at the given position. For use of
|
124 |
|
|
* <code>index</code> see {@link List#add(int, Object)} and {@link#getIdentifiers()}
|
125 |
|
|
* @param index the list index
|
126 |
|
|
*/
|
127 |
|
|
public void removeIdentifier(int index);
|
128 |
|
|
|
129 |
|
|
|
130 |
|
|
/**
|
131 |
|
|
* Removes an identifier
|
132 |
|
|
* @see #getIdentifiers()
|
133 |
|
|
* @param identifier
|
134 |
|
|
*/
|
135 |
5b99edea
|
Patric Plitzner
|
public void removeIdentifier(Identifier identifier);
|
136 |
6d5812d1
|
Andreas Müller
|
|
137 |
|
|
|
138 |
13b550a3
|
Andreas Kohlbecker
|
/**
|
139 |
|
|
* Overrides {@link eu.etaxonomy.cdm.model.common.CdmBase#toString()}.
|
140 |
|
|
* This returns an String that identifies the object well without beeing necessarily unique.
|
141 |
|
|
* Specification: This method should never call other object' methods so it can be well used for debugging
|
142 |
|
|
* without problems like lazy loading, unreal states etc.
|
143 |
|
|
* Note: If overriding this method's javadoc always copy or link the above requirement.
|
144 |
|
|
* If not overwritten by a subclass method returns the class, id and uuid as a string for any CDM object.
|
145 |
|
|
* For example: Taxon#13<b5938a98-c1de-4dda-b040-d5cc5bfb3bc0>
|
146 |
|
|
* @see java.lang.Object#toString()
|
147 |
|
|
*/
|
148 |
503e6c4e
|
Patric Plitzner
|
@Override
|
149 |
13b550a3
|
Andreas Kohlbecker
|
public String toString();
|
150 |
|
|
|
151 |
|
|
public byte[] getData();
|
152 |
ee91bcd9
|
ben.clark
|
|
153 |
a22369e9
|
Katja Luther
|
void removeSources();
|
154 |
|
|
|
155 |
788ff862
|
Andreas Müller
|
}
|