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
|
import javax.persistence.Entity;
|
13
|
import javax.xml.bind.annotation.XmlAccessType;
|
14
|
import javax.xml.bind.annotation.XmlAccessorType;
|
15
|
import javax.xml.bind.annotation.XmlRootElement;
|
16
|
import javax.xml.bind.annotation.XmlType;
|
17
|
|
18
|
import org.apache.log4j.Logger;
|
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 cultivars (cultivated plants). The only possible
|
25
|
* {@link Rank ranks} for cultivars are CULTIVAR, GREX, CONVAR, CULTIVAR_GROUP,
|
26
|
* GRAFT_CHIMAERA or DENOMINATION_CLASS.
|
27
|
* <P>
|
28
|
* This class corresponds partially to: NameBotanical according to the
|
29
|
* ABCD schema.
|
30
|
*
|
31
|
* @author m.doering
|
32
|
* @created 08-Nov-2007 13:06:18
|
33
|
*/
|
34
|
@XmlAccessorType(XmlAccessType.FIELD)
|
35
|
@XmlType(name = "", propOrder = {})
|
36
|
@XmlRootElement(name = "CultivarPlantName")
|
37
|
@Entity
|
38
|
@Indexed(index = "eu.etaxonomy.cdm.model.name.TaxonNameBase")
|
39
|
@Audited
|
40
|
@Configurable
|
41
|
public class CultivarPlantName
|
42
|
extends BotanicalName {
|
43
|
private static final long serialVersionUID = -7948375817971980004L;
|
44
|
|
45
|
@SuppressWarnings("unused")
|
46
|
private static final Logger logger = Logger.getLogger(CultivarPlantName.class);
|
47
|
|
48
|
|
49
|
// ************* CONSTRUCTORS *************/
|
50
|
/**
|
51
|
* Class constructor: creates a new cultivar taxon name instance
|
52
|
* only containing the {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}.
|
53
|
*
|
54
|
* @see #CultivarPlantName(Rank, HomotypicalGroup)
|
55
|
* @see eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
|
56
|
*/
|
57
|
public CultivarPlantName(){
|
58
|
super();
|
59
|
}
|
60
|
|
61
|
/**
|
62
|
* Class constructor: creates a new cultivar taxon name instance
|
63
|
* only containing its {@link Rank rank},
|
64
|
* its {@link HomotypicalGroup homotypical group} and
|
65
|
* the {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}.
|
66
|
* The new cultivar taxon name instance will be also added to the set of
|
67
|
* cultivar taxon names belonging to this homotypical group.
|
68
|
*
|
69
|
* @param rank the rank to be assigned to <i>this</i> cultivar taxon name
|
70
|
* @param homotypicalGroup the homotypical group to which <i>this</i> cultivar taxon name belongs
|
71
|
* @see #CultivarPlantName()
|
72
|
* @see eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
|
73
|
*/
|
74
|
protected CultivarPlantName(Rank rank, HomotypicalGroup homotypicalGroup) {
|
75
|
super(rank, homotypicalGroup);
|
76
|
}
|
77
|
|
78
|
|
79
|
//*************************
|
80
|
|
81
|
|
82
|
/**
|
83
|
* Returns the {@link NomenclaturalCode nomenclatural code} that governs
|
84
|
* the construction of <i>this</i> cultivar taxon name, that is the
|
85
|
* International Code of Nomenclature for Cultivated Plants. This method
|
86
|
* overrides the getNomenclaturalCode method from {@link NonViralName#getNomenclaturalCode() NonViralName}.
|
87
|
*
|
88
|
* @return the nomenclatural code for cultivated plants
|
89
|
* @see NonViralName#isCodeCompliant()
|
90
|
* @see TaxonNameBase#getHasProblem()
|
91
|
*/
|
92
|
@Override
|
93
|
public NomenclaturalCode getNomenclaturalCode(){
|
94
|
return NomenclaturalCode.ICNCP;
|
95
|
}
|
96
|
|
97
|
|
98
|
//*********************** CLONE ********************************************************/
|
99
|
|
100
|
/**
|
101
|
* Clones <i>this</i> cultivar plant name. This is a shortcut that enables to create
|
102
|
* a new instance that differs only slightly from <i>this</i> cultivar plant name by
|
103
|
* modifying only some of the attributes.
|
104
|
*
|
105
|
* @see eu.etaxonomy.cdm.model.name.BotanicalName#clone()
|
106
|
* @see java.lang.Object#clone()
|
107
|
*/
|
108
|
@Override
|
109
|
public Object clone() {
|
110
|
CultivarPlantName result = (CultivarPlantName)super.clone();
|
111
|
//no changes to:
|
112
|
return result;
|
113
|
}
|
114
|
|
115
|
}
|