2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.model
.name
;
13 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnitBase
;
14 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
15 import eu
.etaxonomy
.cdm
.model
.common
.ReferencedEntityBase
;
16 import org
.apache
.log4j
.Logger
;
17 import org
.hibernate
.annotations
.Cascade
;
18 import org
.hibernate
.annotations
.CascadeType
;
22 import javax
.persistence
.*;
23 import javax
.xml
.bind
.annotation
.XmlAccessType
;
24 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
25 import javax
.xml
.bind
.annotation
.XmlElement
;
26 import javax
.xml
.bind
.annotation
.XmlElementWrapper
;
27 import javax
.xml
.bind
.annotation
.XmlIDREF
;
28 import javax
.xml
.bind
.annotation
.XmlSchemaType
;
29 import javax
.xml
.bind
.annotation
.XmlType
;
32 * The class representing a typification of an {@link HomotypicalGroup homotypical group} by a
33 * {@link occurrence.DerivedUnitBase specimen or a figure}. This allows to define a specimen type designation
34 * only once for the homotypical group instead of defining a type designation
35 * for each one of the taxon names subsumed under one homotypical group.
36 * All {@link TaxonNameBase taxon names} which have a {@link Rank rank}
37 * "species aggregate" or lower can only be typified by specimens.
38 * Moreover each typification by a specimen (or by a figure) has a {@link TypeDesignationStatus status}
39 * like "holotype" or "isotype".
41 * This class corresponds to: <ul>
42 * <li> NomenclaturalType according to the TDWG ontology
43 * <li> Typification (partially) according to the TCS
44 * <li> NomenclaturalTypeDesignation according to the ABCD schema
47 * @see NameTypeDesignation
50 * @created 08-Nov-2007 13:06:38
52 @XmlAccessorType(XmlAccessType
.FIELD
)
53 @XmlType(name
= "SpecimenTypeDesignation", propOrder
= {
60 public class SpecimenTypeDesignation
extends TypeDesignationBase
implements ITypeDesignation
{
62 private static final Logger logger
= Logger
.getLogger(SpecimenTypeDesignation
.class);
64 @XmlElement(name
= "TypeSpecimen")
66 // @XmlSchemaType(name = "IDREF")
67 private DerivedUnitBase typeSpecimen
;
69 @XmlElement(name
= "TypeStatus")
70 private TypeDesignationStatus typeStatus
;
76 // * Creates a new specimen type designation instance
77 // * (including its {@link reference.ReferenceBase reference source} and eventually
78 // * the taxon name string originally used by this reference when establishing
79 // * the former designation) and adds it to the corresponding
80 // * {@link HomotypicalGroup#getSpecimenTypeDesignations() specimen type designation set} of the
81 // * {@link HomotypicalGroup homotypical group}.
83 // * @param specimen the derived unit (specimen or figure) used as type
84 // * @param status the type designation status
85 // * @param citation the reference source for the new designation
86 // * @param citationMicroReference the string with the details describing the exact localisation within the reference
87 // * @param originalNameString the taxon name string used originally in the reference source for the new designation
88 // * @see #SpecimenTypeDesignation(DerivedUnitBase, TypeDesignationStatus, ReferenceBase, String, String)
89 // * @see HomotypicalGroup#addSpecimenTypeDesignation(SpecimenTypeDesignation, boolean)
90 // * @see occurrence.DerivedUnitBase
92 // protected static SpecimenTypeDesignation NewInstance2(DerivedUnitBase specimen, TypeDesignationStatus status,
93 // ReferenceBase citation, String citationMicroReference, String originalNameString){
94 // SpecimenTypeDesignation specTypeDesig = new SpecimenTypeDesignation(specimen, status, citation, citationMicroReference, originalNameString);
95 // return specTypeDesig;
99 // ************* CONSTRUCTORS *************/
101 * Class constructor: creates a new empty specimen type designation.
103 * @see #SpecimenTypeDesignation(DerivedUnitBase, TypeDesignationStatus,
104 * ReferenceBase, String, String)
106 protected SpecimenTypeDesignation(){
111 * Class constructor: creates a new specimen type designation instance
112 * (including its {@link reference.ReferenceBase reference source} and
113 * eventually the taxon name string originally used by this reference when
114 * establishing the former designation) and adds it to the corresponding
115 * {@link HomotypicalGroup#getSpecimenTypeDesignations() specimen type
116 * designation set} of the {@link HomotypicalGroup homotypical group}.
118 * @param specimen the derived unit (specimen or figure) used
120 * @param status the type designation status
121 * @param citation the reference source for the new designation
122 * @param citationMicroReference the string with the details describing
123 * the exact localisation within the reference
124 * @param originalNameString the taxon name string used originally in the
125 * reference source for the new designation
126 * @see #SpecimenTypeDesignation()
127 * @see HomotypicalGroup#addSpecimenTypeDesignation(SpecimenTypeDesignation, boolean)
128 * @see occurrence.DerivedUnitBase
130 protected SpecimenTypeDesignation(DerivedUnitBase specimen
, TypeDesignationStatus status
, ReferenceBase citation
, String citationMicroReference
,
131 String originalNameString
) {
132 super(citation
, citationMicroReference
, originalNameString
);
133 this.setTypeSpecimen(specimen
);
134 this.setTypeStatus(status
);
140 //********* METHODS **************************************/
145 * Returns the {@link occurrence.DerivedUnitBase derived unit} (specimen or figure) that is used
146 * in <i>this</i> specimen type designation to typify the {@link HomotypicalGroup homotypical group}.
148 * @see #getHomotypicalGroup()
151 @Cascade({CascadeType
.SAVE_UPDATE
})
152 public DerivedUnitBase
getTypeSpecimen(){
153 return this.typeSpecimen
;
156 * @see #getTypeSpecimen()
158 public void setTypeSpecimen(DerivedUnitBase typeSpecimen
){
159 this.typeSpecimen
= typeSpecimen
;
163 * Returns the {@link TypeDesignationStatus type designation status} for <i>this</i> specimen type
164 * designation. This status describes which of the possible categories of
165 * types like "holotype", "neotype", "syntype" or "isotype" applies to <i>this</i>
166 * specimen type designation.
169 public TypeDesignationStatus
getTypeStatus(){
170 return this.typeStatus
;
173 * @see #getTypeStatus()
175 public void setTypeStatus(TypeDesignationStatus typeStatus
){
176 this.typeStatus
= typeStatus
;
180 * @see eu.etaxonomy.cdm.model.name.ITypeDesignation#isLectoType()
183 * Returns the boolean value indicating whether <i>this</i> specimen type
184 * designation has a "lectotype" status (true) or not (false).<BR>
185 * A lectotype is a {@link occurrence.DerivedUnitBase specimen or illustration} designated as the
186 * nomenclatural type, when no holotype was indicated at the time of
187 * publication of the "type-bringing" {@link TaxonNameBase taxon name}, when the
188 * holotype is found to belong to more than one {@link HomotypicalGroup homotypical group},
189 * or as long as it is missing.
191 * @see TypeDesignationStatus#isLectotype()
192 * @see TypeDesignationStatus#HOLOTYPE()
195 public boolean isLectoType() {
196 return typeStatus
.isLectotype();