Revision 9dc896c9
Added by Andreas Müller almost 7 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/NameTypeDesignation.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 |
*/ |
... | ... | |
29 | 29 |
import eu.etaxonomy.cdm.model.reference.Reference; |
30 | 30 |
|
31 | 31 |
/** |
32 |
* The class representing a typification of a {@link TaxonNameBase taxon name} with a {@link Rank rank}
|
|
32 |
* The class representing a typification of a {@link TaxonName taxon name} with a {@link Rank rank} |
|
33 | 33 |
* above "species aggregate" by another taxon name.<BR> |
34 | 34 |
* According to nomenclature a type of a genus name or of any subdivision of a |
35 | 35 |
* genus can only be a species name. A type of a family name or of any |
... | ... | |
41 | 41 |
* cannot be simultaneously rejected and conserved.<BR> |
42 | 42 |
* Name type designations are treated as {@link TypeDesignationBase type designations} |
43 | 43 |
* and not as {@link NameRelationship name relationships}. |
44 |
*
|
|
44 |
* |
|
45 | 45 |
* @see TypeDesignationBase |
46 | 46 |
* @see SpecimenTypeDesignation |
47 | 47 |
* @author m.doering |
... | ... | |
60 | 60 |
public class NameTypeDesignation extends TypeDesignationBase<NameTypeDesignationStatus> implements ITypeDesignation, Cloneable { |
61 | 61 |
private static final long serialVersionUID = 8478663508862210879L; |
62 | 62 |
final static Logger logger = Logger.getLogger(NameTypeDesignation.class); |
63 |
|
|
63 |
|
|
64 | 64 |
@XmlElement(name = "IsRejectedType") |
65 | 65 |
private boolean rejectedType; |
66 |
|
|
66 |
|
|
67 | 67 |
@XmlElement(name = "IsConservedType") |
68 | 68 |
private boolean conservedType; |
69 |
|
|
69 |
|
|
70 | 70 |
@XmlElement(name = "TypeName") |
71 | 71 |
@XmlIDREF |
72 | 72 |
@XmlSchemaType(name = "IDREF") |
73 | 73 |
@ManyToOne(fetch = FetchType.LAZY) |
74 | 74 |
@Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE}) |
75 |
private TaxonNameBase typeName; |
|
75 |
private TaxonName typeName; |
|
76 |
|
|
76 | 77 |
|
77 |
|
|
78 | 78 |
public static NameTypeDesignation NewInstance() { |
79 | 79 |
return new NameTypeDesignation(); |
80 | 80 |
} |
81 |
|
|
82 |
|
|
83 |
// ************* CONSTRUCTORS *************/
|
|
84 |
/**
|
|
81 |
|
|
82 |
|
|
83 |
// ************* CONSTRUCTORS *************/ |
|
84 |
/** |
|
85 | 85 |
* Class constructor: creates a new empty name type designation. |
86 |
*
|
|
87 |
* @see #NameTypeDesignation(TaxonNameBase, Reference, String, String, boolean, boolean, boolean)
|
|
86 |
* |
|
87 |
* @see #NameTypeDesignation(TaxonName, Reference, String, String, boolean, boolean, boolean) |
|
88 | 88 |
*/ |
89 | 89 |
protected NameTypeDesignation() { |
90 | 90 |
} |
... | ... | |
95 | 95 |
* (including its {@link eu.etaxonomy.cdm.model.reference.Reference reference source} and eventually |
96 | 96 |
* the taxon name string originally used by this reference when establishing |
97 | 97 |
* the former designation). |
98 |
*
|
|
99 |
* @param typeName the taxon name used as a type
|
|
98 |
* |
|
99 |
* @param typeName the taxon name used as a type |
|
100 | 100 |
* @param citation the reference source for the new designation |
101 | 101 |
* @param citationMicroReference the string with the details describing the exact localisation within the reference |
102 | 102 |
* @param originalNameString the taxon name string used originally in the reference source for the new designation |
... | ... | |
104 | 104 |
* <i>this</i> name type designation |
105 | 105 |
* @param isConservedType the boolean flag indicating whether the competent authorities conserved |
106 | 106 |
* <i>this</i> name type designation |
107 |
* @param isNotDesignated the boolean flag indicating whether there is no name type at all for
|
|
107 |
* @param isNotDesignated the boolean flag indicating whether there is no name type at all for |
|
108 | 108 |
* <i>this</i> name type designation |
109 | 109 |
* @see #NameTypeDesignation() |
110 | 110 |
* @see TypeDesignationBase#isNotDesignated() |
111 |
* @see TaxonNameBase#addNameTypeDesignation(TaxonNameBase, Reference, String, String, boolean, boolean, boolean, boolean, boolean)
|
|
111 |
* @see TaxonName#addNameTypeDesignation(TaxonName, Reference, String, String, boolean, boolean, boolean, boolean, boolean)
|
|
112 | 112 |
*/ |
113 |
protected NameTypeDesignation(TaxonNameBase typeName, NameTypeDesignationStatus status,
|
|
113 |
protected NameTypeDesignation(TaxonName typeName, NameTypeDesignationStatus status, |
|
114 | 114 |
Reference citation, String citationMicroReference, String originalNameString) { |
115 | 115 |
super(citation, citationMicroReference, originalNameString); |
116 | 116 |
this.setTypeName(typeName); |
... | ... | |
122 | 122 |
* (including its {@link eu.etaxonomy.cdm.model.reference.Reference reference source} and eventually |
123 | 123 |
* the taxon name string originally used by this reference when establishing |
124 | 124 |
* the former designation). |
125 |
*
|
|
126 |
* @param typeName the taxon name used as a type
|
|
125 |
* |
|
126 |
* @param typeName the taxon name used as a type |
|
127 | 127 |
* @param citation the reference source for the new designation |
128 | 128 |
* @param citationMicroReference the string with the details describing the exact localisation within the reference |
129 | 129 |
* @param originalNameString the taxon name string used originally in the reference source for the new designation |
... | ... | |
131 | 131 |
* <i>this</i> name type designation |
132 | 132 |
* @param isConservedType the boolean flag indicating whether the competent authorities conserved |
133 | 133 |
* <i>this</i> name type designation |
134 |
* @param isNotDesignated the boolean flag indicating whether there is no name type at all for
|
|
134 |
* @param isNotDesignated the boolean flag indicating whether there is no name type at all for |
|
135 | 135 |
* <i>this</i> name type designation |
136 | 136 |
* @see #NameTypeDesignation() |
137 | 137 |
* @see TypeDesignationBase#isNotDesignated() |
138 |
* @see TaxonNameBase#addNameTypeDesignation(TaxonNameBase, Reference, String, String, boolean, boolean, boolean, boolean, boolean)
|
|
138 |
* @see TaxonName#addNameTypeDesignation(TaxonName, Reference, String, String, boolean, boolean, boolean, boolean, boolean)
|
|
139 | 139 |
*/ |
140 |
protected NameTypeDesignation( TaxonNameBase typeName,
|
|
141 |
Reference citation,
|
|
140 |
protected NameTypeDesignation( TaxonName typeName,
|
|
141 |
Reference citation, |
|
142 | 142 |
String citationMicroReference, |
143 |
String originalNameString,
|
|
144 |
NameTypeDesignationStatus status,
|
|
145 |
boolean rejectedType,
|
|
146 |
boolean conservedType,
|
|
143 |
String originalNameString, |
|
144 |
NameTypeDesignationStatus status, |
|
145 |
boolean rejectedType, |
|
146 |
boolean conservedType, |
|
147 | 147 |
boolean isNotDesignated |
148 | 148 |
) { |
149 | 149 |
this(typeName, status, citation, citationMicroReference, originalNameString); |
... | ... | |
151 | 151 |
this.rejectedType = rejectedType; |
152 | 152 |
this.conservedType = conservedType; |
153 | 153 |
} |
154 |
|
|
154 |
|
|
155 | 155 |
//********* METHODS **************************************/ |
156 | 156 |
|
157 | 157 |
|
... | ... | |
160 | 160 |
*/ |
161 | 161 |
@Override |
162 | 162 |
public void removeType() { |
163 |
this.typeName = null;
|
|
163 |
this.typeName = null; |
|
164 | 164 |
} |
165 |
|
|
166 |
/**
|
|
167 |
* Returns the {@link TaxonNameBase taxon name} that plays the role of the
|
|
165 |
|
|
166 |
/** |
|
167 |
* Returns the {@link TaxonName taxon name} that plays the role of the |
|
168 | 168 |
* taxon name type in <i>this</i> taxon name type designation. The {@link Rank rank} |
169 | 169 |
* of the taxon name type must be "species". |
170 | 170 |
*/ |
171 |
public TaxonNameBase getTypeName(){
|
|
171 |
public TaxonName getTypeName(){ |
|
172 | 172 |
return this.typeName; |
173 | 173 |
} |
174 | 174 |
/** |
175 | 175 |
* @see #getTypeName() |
176 | 176 |
*/ |
177 |
public void setTypeName(TaxonNameBase typeName){
|
|
177 |
public void setTypeName(TaxonName typeName){ |
|
178 | 178 |
this.typeName = typeName; |
179 | 179 |
} |
180 | 180 |
|
181 |
/**
|
|
181 |
/** |
|
182 | 182 |
* Returns the boolean value "true" if the competent authorities decided to |
183 | 183 |
* reject the use of the species taxon name as the type for <i>this</i> taxon |
184 | 184 |
* name type designation. |
185 |
*
|
|
185 |
* |
|
186 | 186 |
* @see #isConservedType() |
187 | 187 |
*/ |
188 | 188 |
public boolean isRejectedType(){ |
... | ... | |
195 | 195 |
this.rejectedType = rejectedType; |
196 | 196 |
} |
197 | 197 |
|
198 |
/**
|
|
198 |
/** |
|
199 | 199 |
* Returns the boolean value "true" if the competent authorities decided to |
200 | 200 |
* conserve the use of the species taxon name as the type for <i>this</i> taxon |
201 | 201 |
* name type designation. |
202 |
*
|
|
202 |
* |
|
203 | 203 |
* @see #isRejectedType() |
204 | 204 |
*/ |
205 | 205 |
public boolean isConservedType(){ |
... | ... | |
212 | 212 |
this.conservedType = conservedType; |
213 | 213 |
} |
214 | 214 |
|
215 |
@Transient |
|
215 |
@Override |
|
216 |
@Transient |
|
216 | 217 |
public boolean isLectoType() { |
217 | 218 |
if (getTypeStatus() == null) { |
218 | 219 |
return false; |
219 | 220 |
} |
220 | 221 |
return getTypeStatus().isLectotype(); |
221 | 222 |
} |
222 |
|
|
223 |
/**
|
|
224 |
* Returns the boolean value "true" if the use of the species {@link TaxonNameBase taxon name}
|
|
223 |
|
|
224 |
/** |
|
225 |
* Returns the boolean value "true" if the use of the species {@link TaxonName taxon name} |
|
225 | 226 |
* as the type for <i>this</i> taxon name type designation was posterior to the |
226 | 227 |
* publication of the typified taxon name. In this case the taxon name type |
227 | 228 |
* designation should have a {@link eu.etaxonomy.cdm.model.reference.Reference reference} that is different to the |
228 |
* {@link TaxonNameBase#getNomenclaturalReference() nomenclatural reference} of the typified taxon name.
|
|
229 |
*
|
|
229 |
* {@link TaxonName#getNomenclaturalReference() nomenclatural reference} of the typified taxon name. |
|
230 |
* |
|
230 | 231 |
* @see ReferencedEntityBase#getCitation() |
231 | 232 |
*/ |
232 | 233 |
// /* (non-Javadoc) |
... | ... | |
242 | 243 |
// public void setLectoType(boolean lectoType) { |
243 | 244 |
// this.lectoType = lectoType; |
244 | 245 |
// } |
245 |
|
|
246 |
|
|
246 | 247 |
//*********************** CLONE ********************************************************/ |
247 |
|
|
248 |
/**
|
|
248 |
|
|
249 |
/** |
|
249 | 250 |
* Clones <i>this</i> name type. This is a shortcut that enables to create |
250 | 251 |
* a new instance that differs only slightly from <i>this</i> name type by |
251 | 252 |
* modifying only some of the attributes. |
252 |
*
|
|
253 |
* |
|
253 | 254 |
* @see eu.etaxonomy.cdm.model.name.TypeDesignationBase#clone() |
254 | 255 |
* @see java.lang.Object#clone() |
255 | 256 |
*/ |
Also available in: Unified diff
fix #6368 rename table and class TaxonNameBase