Revision e6d7b501
Added by Andreas Müller almost 7 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/ZoologicalName.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2007 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.name; |
|
11 |
|
|
12 |
|
|
13 |
import javax.persistence.Entity; |
|
14 |
import javax.xml.bind.annotation.XmlAccessType; |
|
15 |
import javax.xml.bind.annotation.XmlAccessorType; |
|
16 |
import javax.xml.bind.annotation.XmlRootElement; |
|
17 |
import javax.xml.bind.annotation.XmlType; |
|
18 |
|
|
19 |
import org.apache.log4j.Logger; |
|
20 |
import org.hibernate.envers.Audited; |
|
21 |
import org.hibernate.search.annotations.Indexed; |
|
22 |
import org.springframework.beans.factory.annotation.Configurable; |
|
23 |
|
|
24 |
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase; |
|
25 |
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference; |
|
26 |
import eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy; |
|
27 |
|
|
28 |
/** |
|
29 |
* The taxon name class for animals. |
|
30 |
* <P> |
|
31 |
* This class corresponds to: NameZoological according to the ABCD schema. |
|
32 |
* |
|
33 |
* @author m.doering |
|
34 |
* @created 08-Nov-2007 13:07:03 |
|
35 |
* @see NonViralName |
|
36 |
*/ |
|
37 |
@XmlAccessorType(XmlAccessType.FIELD) |
|
38 |
@XmlType(name = "ZoologicalName", propOrder = { |
|
39 |
|
|
40 |
}) |
|
41 |
@XmlRootElement(name = "ZoologicalName") |
|
42 |
@Entity |
|
43 |
@Indexed(index = "eu.etaxonomy.cdm.model.name.TaxonNameBase") |
|
44 |
@Audited |
|
45 |
@Configurable |
|
46 |
public class ZoologicalName |
|
47 |
extends NonViralName<ZoologicalName>{ |
|
48 |
private static final long serialVersionUID = 845745609734814484L; |
|
49 |
@SuppressWarnings("unused") |
|
50 |
private static final Logger logger = Logger.getLogger(ZoologicalName.class); |
|
51 |
|
|
52 |
private static final NomenclaturalCode code = NomenclaturalCode.ICZN; |
|
53 |
|
|
54 |
|
|
55 |
// ************* CONSTRUCTORS *************/ |
|
56 |
/** |
|
57 |
* Class constructor: creates a new zoological taxon name instance |
|
58 |
* only containing the {@link eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy default cache strategy}. |
|
59 |
* |
|
60 |
* @see #ZoologicalName(Rank, HomotypicalGroup) |
|
61 |
* @see #ZoologicalName(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup) |
|
62 |
* @see eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy |
|
63 |
*/ |
|
64 |
protected ZoologicalName() { |
|
65 |
super(code); |
|
66 |
this.cacheStrategy = ZooNameDefaultCacheStrategy.NewInstance(); |
|
67 |
} |
|
68 |
|
|
69 |
/** |
|
70 |
* Class constructor: creates a new zoological taxon name instance |
|
71 |
* only containing its {@link Rank rank}, |
|
72 |
* its {@link HomotypicalGroup homotypical group} and |
|
73 |
* the {@link eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy default cache strategy}. |
|
74 |
* The new zoological taxon name instance will be also added to the set of |
|
75 |
* zoological taxon names belonging to the given homotypical group. |
|
76 |
* |
|
77 |
* @param rank the rank to be assigned to <i>this</i> zoological taxon name |
|
78 |
* @param homotypicalGroup the homotypical group to which <i>this</i> zoological taxon name belongs |
|
79 |
* @see #ZoologicalName() |
|
80 |
* @see #ZoologicalName(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup) |
|
81 |
* @see eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy |
|
82 |
*/ |
|
83 |
protected ZoologicalName(Rank rank, HomotypicalGroup homotypicalGroup) { |
|
84 |
super(code, rank, homotypicalGroup); |
|
85 |
this.cacheStrategy = ZooNameDefaultCacheStrategy.NewInstance(); |
|
86 |
} |
|
87 |
|
|
88 |
/** |
|
89 |
* Class constructor: creates a new zoological taxon name instance |
|
90 |
* containing its {@link Rank rank}, |
|
91 |
* its {@link HomotypicalGroup homotypical group}, |
|
92 |
* its scientific name components, its {@link eu.etaxonomy.cdm.agent.TeamOrPersonBase author(team)}, |
|
93 |
* its {@link eu.etaxonomy.cdm.reference.INomenclaturalReference nomenclatural reference} and |
|
94 |
* the {@link eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy default cache strategy}. |
|
95 |
* The new zoological taxon name instance will be also added to the set of |
|
96 |
* zoological taxon names belonging to the given homotypical group. |
|
97 |
* |
|
98 |
* @param rank the rank to be assigned to <i>this</i> zoological taxon name |
|
99 |
* @param genusOrUninomial the string for <i>this</i> zoological taxon name |
|
100 |
* if its rank is genus or higher or for the genus part |
|
101 |
* if its rank is lower than genus |
|
102 |
* @param infraGenericEpithet the string for the first epithet of |
|
103 |
* <i>this</i> zoological taxon name if its rank is lower than genus |
|
104 |
* and higher than species aggregate |
|
105 |
* @param specificEpithet the string for the first epithet of |
|
106 |
* <i>this</i> zoological taxon name if its rank is species aggregate or lower |
|
107 |
* @param infraSpecificEpithet the string for the second epithet of |
|
108 |
* <i>this</i> zoological taxon name if its rank is lower than species |
|
109 |
* @param combinationAuthorship the author or the team who published <i>this</i> zoological taxon name |
|
110 |
* @param nomenclaturalReference the nomenclatural reference where <i>this</i> zoological taxon name was published |
|
111 |
* @param nomenclMicroRef the string with the details for precise location within the nomenclatural reference |
|
112 |
* @param homotypicalGroup the homotypical group to which <i>this</i> zoological taxon name belongs |
|
113 |
* @see #ZoologicalName() |
|
114 |
* @see #ZoologicalName(Rank, HomotypicalGroup) |
|
115 |
* @see #NewZoologicalInstance(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup) |
|
116 |
* @see eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy |
|
117 |
* @see eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy |
|
118 |
* @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy |
|
119 |
*/ |
|
120 |
protected ZoologicalName (Rank rank, String genusOrUninomial, String infraGenericEpithet, String specificEpithet, String infraSpecificEpithet, TeamOrPersonBase combinationAuthorship, INomenclaturalReference nomenclaturalReference, String nomenclMicroRef, HomotypicalGroup homotypicalGroup) { |
|
121 |
super(code, rank, genusOrUninomial, infraGenericEpithet, specificEpithet, infraSpecificEpithet, combinationAuthorship, nomenclaturalReference, nomenclMicroRef, homotypicalGroup); |
|
122 |
this.cacheStrategy = ZooNameDefaultCacheStrategy.NewInstance(); |
|
123 |
} |
|
124 |
|
|
125 |
|
|
126 |
//********* METHODS **************************************/ |
|
127 |
|
|
128 |
|
|
129 |
/** |
|
130 |
* Returns the {@link NomenclaturalCode nomenclatural code} that governs |
|
131 |
* the construction of <i>this</i> zoological taxon name, that is the |
|
132 |
* International Code of Zoological Nomenclature. This method overrides |
|
133 |
* the getNomenclaturalCode method from {@link INonViralName NonViralName}. |
|
134 |
* |
|
135 |
* @return the nomenclatural code for animals |
|
136 |
* @see NonViralName#isCodeCompliant() |
|
137 |
* @see NonViralName#getNomenclaturalCode() |
|
138 |
* @see TaxonNameBase#getHasProblem() |
|
139 |
*/ |
|
140 |
@Override |
|
141 |
public NomenclaturalCode getNomenclaturalCode(){ |
|
142 |
return code; |
|
143 |
} |
|
144 |
|
|
145 |
|
|
146 |
//*********************** CLONE ********************************************************/ |
|
147 |
|
|
148 |
/** |
|
149 |
* Clones <i>this</i> zoological name. This is a shortcut that enables to create |
|
150 |
* a new instance that differs only slightly from <i>this</i> zoological name by |
|
151 |
* modifying only some of the attributes. |
|
152 |
* |
|
153 |
* @see eu.etaxonomy.cdm.model.name.NonViralName#clone() |
|
154 |
* @see java.lang.Object#clone() |
|
155 |
*/ |
|
156 |
@Override |
|
157 |
public Object clone() { |
|
158 |
IZoologicalName result = (IZoologicalName)super.clone(); |
|
159 |
//no changes to: breed, publicationYear, originalPublicationYear |
|
160 |
return result; |
|
161 |
} |
|
162 |
} |
|
1 |
///** |
|
2 |
//* Copyright (C) 2007 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.name; |
|
11 |
// |
|
12 |
// |
|
13 |
//import javax.persistence.Entity; |
|
14 |
//import javax.xml.bind.annotation.XmlAccessType; |
|
15 |
//import javax.xml.bind.annotation.XmlAccessorType; |
|
16 |
//import javax.xml.bind.annotation.XmlRootElement; |
|
17 |
//import javax.xml.bind.annotation.XmlType; |
|
18 |
// |
|
19 |
//import org.hibernate.envers.Audited; |
|
20 |
//import org.hibernate.search.annotations.Indexed; |
|
21 |
//import org.springframework.beans.factory.annotation.Configurable; |
|
22 |
// |
|
23 |
///** |
|
24 |
// * The taxon name class for animals. |
|
25 |
// * <P> |
|
26 |
// * This class corresponds to: NameZoological according to the ABCD schema. |
|
27 |
// * |
|
28 |
// * @author m.doering |
|
29 |
// * @created 08-Nov-2007 13:07:03 |
|
30 |
// * @see NonViralName |
|
31 |
// */ |
|
32 |
//@XmlAccessorType(XmlAccessType.FIELD) |
|
33 |
//@XmlType(name = "ZoologicalName", propOrder = { |
|
34 |
// |
|
35 |
//}) |
|
36 |
//@XmlRootElement(name = "ZoologicalName") |
|
37 |
//@Entity |
|
38 |
//@Indexed(index = "eu.etaxonomy.cdm.model.name.TaxonNameBase") |
|
39 |
//@Audited |
|
40 |
//@Configurable |
|
41 |
//public class ZoologicalName4{ |
|
42 |
//// extends NonViralName<ZoologicalName>{ |
|
43 |
//// private static final long serialVersionUID = 845745609734814484L; |
|
44 |
//// @SuppressWarnings("unused") |
|
45 |
//// private static final Logger logger = Logger.getLogger(ZoologicalName.class); |
|
46 |
//// |
|
47 |
//// private static final NomenclaturalCode code = NomenclaturalCode.ICZN; |
|
48 |
// |
|
49 |
// |
|
50 |
// // ************* CONSTRUCTORS *************/ |
|
51 |
// /** |
|
52 |
// * Class constructor: creates a new zoological taxon name instance |
|
53 |
// * only containing the {@link eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy default cache strategy}. |
|
54 |
// * |
|
55 |
// * @see #ZoologicalName(Rank, HomotypicalGroup) |
|
56 |
// * @see #ZoologicalName(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup) |
|
57 |
// * @see eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy |
|
58 |
// */ |
|
59 |
//// protected ZoologicalName() { |
|
60 |
//// super(code); |
|
61 |
//// this.cacheStrategy = ZooNameDefaultCacheStrategy.NewInstance(); |
|
62 |
//// } |
|
63 |
// |
|
64 |
// /** |
|
65 |
// * Class constructor: creates a new zoological taxon name instance |
|
66 |
// * only containing its {@link Rank rank}, |
|
67 |
// * its {@link HomotypicalGroup homotypical group} and |
|
68 |
// * the {@link eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy default cache strategy}. |
|
69 |
// * The new zoological taxon name instance will be also added to the set of |
|
70 |
// * zoological taxon names belonging to the given homotypical group. |
|
71 |
// * |
|
72 |
// * @param rank the rank to be assigned to <i>this</i> zoological taxon name |
|
73 |
// * @param homotypicalGroup the homotypical group to which <i>this</i> zoological taxon name belongs |
|
74 |
// * @see #ZoologicalName() |
|
75 |
// * @see #ZoologicalName(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup) |
|
76 |
// * @see eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy |
|
77 |
// */ |
|
78 |
//// protected ZoologicalName(Rank rank, HomotypicalGroup homotypicalGroup) { |
|
79 |
//// super(code, rank, homotypicalGroup); |
|
80 |
//// this.cacheStrategy = ZooNameDefaultCacheStrategy.NewInstance(); |
|
81 |
//// } |
|
82 |
// |
|
83 |
// /** |
|
84 |
// * Class constructor: creates a new zoological taxon name instance |
|
85 |
// * containing its {@link Rank rank}, |
|
86 |
// * its {@link HomotypicalGroup homotypical group}, |
|
87 |
// * its scientific name components, its {@link eu.etaxonomy.cdm.agent.TeamOrPersonBase author(team)}, |
|
88 |
// * its {@link eu.etaxonomy.cdm.reference.INomenclaturalReference nomenclatural reference} and |
|
89 |
// * the {@link eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy default cache strategy}. |
|
90 |
// * The new zoological taxon name instance will be also added to the set of |
|
91 |
// * zoological taxon names belonging to the given homotypical group. |
|
92 |
// * |
|
93 |
// * @param rank the rank to be assigned to <i>this</i> zoological taxon name |
|
94 |
// * @param genusOrUninomial the string for <i>this</i> zoological taxon name |
|
95 |
// * if its rank is genus or higher or for the genus part |
|
96 |
// * if its rank is lower than genus |
|
97 |
// * @param infraGenericEpithet the string for the first epithet of |
|
98 |
// * <i>this</i> zoological taxon name if its rank is lower than genus |
|
99 |
// * and higher than species aggregate |
|
100 |
// * @param specificEpithet the string for the first epithet of |
|
101 |
// * <i>this</i> zoological taxon name if its rank is species aggregate or lower |
|
102 |
// * @param infraSpecificEpithet the string for the second epithet of |
|
103 |
// * <i>this</i> zoological taxon name if its rank is lower than species |
|
104 |
// * @param combinationAuthorship the author or the team who published <i>this</i> zoological taxon name |
|
105 |
// * @param nomenclaturalReference the nomenclatural reference where <i>this</i> zoological taxon name was published |
|
106 |
// * @param nomenclMicroRef the string with the details for precise location within the nomenclatural reference |
|
107 |
// * @param homotypicalGroup the homotypical group to which <i>this</i> zoological taxon name belongs |
|
108 |
// * @see #ZoologicalName() |
|
109 |
// * @see #ZoologicalName(Rank, HomotypicalGroup) |
|
110 |
// * @see #NewZoologicalInstance(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup) |
|
111 |
// * @see eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy |
|
112 |
// * @see eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy |
|
113 |
// * @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy |
|
114 |
// */ |
|
115 |
//// protected ZoologicalName (Rank rank, String genusOrUninomial, String infraGenericEpithet, String specificEpithet, String infraSpecificEpithet, TeamOrPersonBase combinationAuthorship, INomenclaturalReference nomenclaturalReference, String nomenclMicroRef, HomotypicalGroup homotypicalGroup) { |
|
116 |
//// super(code, rank, genusOrUninomial, infraGenericEpithet, specificEpithet, infraSpecificEpithet, combinationAuthorship, nomenclaturalReference, nomenclMicroRef, homotypicalGroup); |
|
117 |
//// this.cacheStrategy = ZooNameDefaultCacheStrategy.NewInstance(); |
|
118 |
//// } |
|
119 |
// |
|
120 |
// |
|
121 |
// //********* METHODS **************************************/ |
|
122 |
// |
|
123 |
// |
|
124 |
// /** |
|
125 |
// * Returns the {@link NomenclaturalCode nomenclatural code} that governs |
|
126 |
// * the construction of <i>this</i> zoological taxon name, that is the |
|
127 |
// * International Code of Zoological Nomenclature. This method overrides |
|
128 |
// * the getNomenclaturalCode method from {@link INonViralName NonViralName}. |
|
129 |
// * |
|
130 |
// * @return the nomenclatural code for animals |
|
131 |
// * @see NonViralName#isCodeCompliant() |
|
132 |
// * @see NonViralName#getNomenclaturalCode() |
|
133 |
// * @see TaxonNameBase#getHasProblem() |
|
134 |
// */ |
|
135 |
//// @Override |
|
136 |
//// public NomenclaturalCode getNomenclaturalCode(){ |
|
137 |
//// return code; |
|
138 |
//// } |
|
139 |
// |
|
140 |
// |
|
141 |
////*********************** CLONE ********************************************************/ |
|
142 |
// |
|
143 |
// /** |
|
144 |
// * Clones <i>this</i> zoological name. This is a shortcut that enables to create |
|
145 |
// * a new instance that differs only slightly from <i>this</i> zoological name by |
|
146 |
// * modifying only some of the attributes. |
|
147 |
// * |
|
148 |
// * @see eu.etaxonomy.cdm.model.name.NonViralName#clone() |
|
149 |
// * @see java.lang.Object#clone() |
|
150 |
// */ |
|
151 |
// @Override |
|
152 |
// public Object clone() { |
|
153 |
// IZoologicalName result = (IZoologicalName)super.clone(); |
|
154 |
// //no changes to: breed, publicationYear, originalPublicationYear |
|
155 |
// return result; |
|
156 |
// } |
|
157 |
//} |
Also available in: Unified diff
ref #6368 remove TaxonNameBase subclasses