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 org.apache.log4j.Logger;
|
13
|
import org.hibernate.envers.Audited;
|
14
|
import org.hibernate.search.annotations.Indexed;
|
15
|
import org.springframework.beans.factory.annotation.Configurable;
|
16
|
|
17
|
import javax.persistence.*;
|
18
|
import javax.xml.bind.annotation.XmlAccessType;
|
19
|
import javax.xml.bind.annotation.XmlAccessorType;
|
20
|
import javax.xml.bind.annotation.XmlElement;
|
21
|
import javax.xml.bind.annotation.XmlRootElement;
|
22
|
import javax.xml.bind.annotation.XmlType;
|
23
|
|
24
|
/**
|
25
|
* The taxon name class for cultivars (cultivated plants). The only possible
|
26
|
* {@link Rank ranks} for cultivars are CULTIVAR, GREX, CONVAR, CULTIVAR_GROUP,
|
27
|
* GRAFT_CHIMAERA or DENOMINATION_CLASS.
|
28
|
* <P>
|
29
|
* This class corresponds partially to: NameBotanical according to the
|
30
|
* ABCD schema.
|
31
|
*
|
32
|
* @author m.doering
|
33
|
* @version 1.0
|
34
|
* @created 08-Nov-2007 13:06:18
|
35
|
*/
|
36
|
@XmlAccessorType(XmlAccessType.FIELD)
|
37
|
@XmlType(name = "", propOrder = {
|
38
|
"cultivarName"
|
39
|
})
|
40
|
@XmlRootElement(name = "CultivarPlantName")
|
41
|
@Entity
|
42
|
@Indexed(index = "eu.etaxonomy.cdm.model.name.TaxonNameBase")
|
43
|
@Audited
|
44
|
@Configurable
|
45
|
public class CultivarPlantName extends BotanicalName {
|
46
|
static Logger logger = Logger.getLogger(CultivarPlantName.class);
|
47
|
|
48
|
//the characteristical name of the cultivar
|
49
|
@XmlElement(name = "CultivarName", required = true)
|
50
|
private String cultivarName;
|
51
|
|
52
|
// ************* CONSTRUCTORS *************/
|
53
|
/**
|
54
|
* Class constructor: creates a new cultivar taxon name instance
|
55
|
* only containing the {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}.
|
56
|
*
|
57
|
* @see #CultivarPlantName(Rank, HomotypicalGroup)
|
58
|
* @see eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
|
59
|
*/
|
60
|
public CultivarPlantName(){
|
61
|
super();
|
62
|
}
|
63
|
|
64
|
/**
|
65
|
* Class constructor: creates a new cultivar 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.BotanicNameDefaultCacheStrategy default cache strategy}.
|
69
|
* The new cultivar taxon name instance will be also added to the set of
|
70
|
* cultivar taxon names belonging to this homotypical group.
|
71
|
*
|
72
|
* @param rank the rank to be assigned to <i>this</i> cultivar taxon name
|
73
|
* @param homotypicalGroup the homotypical group to which <i>this</i> cultivar taxon name belongs
|
74
|
* @see #CultivarPlantName()
|
75
|
* @see eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
|
76
|
*/
|
77
|
protected CultivarPlantName(Rank rank, HomotypicalGroup homotypicalGroup) {
|
78
|
super(rank, homotypicalGroup);
|
79
|
}
|
80
|
|
81
|
//********* METHODS **************************************/
|
82
|
|
83
|
/**
|
84
|
* Creates a new cultivar taxon name instance
|
85
|
* only containing its {@link Rank rank} and
|
86
|
* the {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}.
|
87
|
*
|
88
|
* @param rank the rank to be assigned to <i>this</i> cultivar taxon name
|
89
|
* @see #CultivarPlantName(Rank, HomotypicalGroup)
|
90
|
* @see #NewInstance(Rank, HomotypicalGroup)
|
91
|
* @see eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
|
92
|
*/
|
93
|
public static CultivarPlantName NewInstance(Rank rank){
|
94
|
return new CultivarPlantName(rank, null);
|
95
|
}
|
96
|
|
97
|
/**
|
98
|
* Creates a new cultivar taxon name instance
|
99
|
* only containing its {@link Rank rank},
|
100
|
* its {@link HomotypicalGroup homotypical group} and
|
101
|
* the {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}.
|
102
|
* The new cultivar taxon name instance will be also added to the set of
|
103
|
* cultivar taxon names belonging to this homotypical group.
|
104
|
*
|
105
|
* @param rank the rank to be assigned to <i>this</i> cultivar taxon name
|
106
|
* @param homotypicalGroup the homotypical group to which <i>this</i> cultivar taxon name belongs
|
107
|
* @see #NewInstance(Rank)
|
108
|
* @see #CultivarPlantName(Rank, HomotypicalGroup)
|
109
|
* @see eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
|
110
|
*/
|
111
|
public static CultivarPlantName NewInstance(Rank rank, HomotypicalGroup homotypicalGroup){
|
112
|
return new CultivarPlantName(rank, homotypicalGroup);
|
113
|
}
|
114
|
|
115
|
/**
|
116
|
* Returns the characteristical cultivar name part string assigned to <i>this</i>
|
117
|
* cultivar taxon name. In the scientific name "Clematis alpina 'Ruby'" for
|
118
|
* instance this characteristical string is "Ruby". This part of the name is
|
119
|
* governed by the International Code for the Nomenclature of Cultivated
|
120
|
* Plants and the string should include neither quotes nor + signs
|
121
|
* (these elements of the name cache string will be generated by the
|
122
|
* {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}).
|
123
|
*/
|
124
|
public String getCultivarName(){
|
125
|
return this.cultivarName;
|
126
|
}
|
127
|
|
128
|
/**
|
129
|
* @see #getCultivarName()
|
130
|
*/
|
131
|
public void setCultivarName(String cultivarName){
|
132
|
this.cultivarName = cultivarName;
|
133
|
}
|
134
|
|
135
|
|
136
|
/**
|
137
|
* Returns the {@link NomenclaturalCode nomenclatural code} that governs
|
138
|
* the construction of <i>this</i> cultivar taxon name, that is the
|
139
|
* International Code of Nomenclature for Cultivated Plants. This method
|
140
|
* overrides the getNomeclaturalCode method from {@link NonViralName#getNomeclaturalCode() NonViralName}.
|
141
|
*
|
142
|
* @return the nomenclatural code for cultivated plants
|
143
|
* @see NonViralName#isCodeCompliant()
|
144
|
* @see TaxonNameBase#getHasProblem()
|
145
|
*/
|
146
|
@Override
|
147
|
public NomenclaturalCode getNomenclaturalCode(){
|
148
|
return NomenclaturalCode.ICNCP;
|
149
|
}
|
150
|
|
151
|
}
|