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 java
.util
.ArrayList
;
15 import javax
.persistence
.CascadeType
;
16 import javax
.persistence
.Entity
;
17 import javax
.persistence
.ManyToOne
;
18 import javax
.persistence
.Transient
;
20 import org
.apache
.log4j
.Logger
;
22 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
23 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableEntity
;
24 import eu
.etaxonomy
.cdm
.model
.common
.Source
;
25 import eu
.etaxonomy
.cdm
.model
.publication
.NomenclaturalReference
;
26 import eu
.etaxonomy
.cdm
.strategy
.INameCacheStrategy
;
28 import javax
.xml
.bind
.annotation
.XmlElement
;
29 import javax
.xml
.bind
.annotation
.XmlRootElement
;
32 * @author Andreas Mueller
34 * @created 15-Aug-2007 18:36:15
36 @XmlRootElement //JAXP test dummy
38 public class TaxonName
extends IdentifiableEntity
{
39 static Logger logger
= Logger
.getLogger(TaxonName
.class);
41 private INameCacheStrategy cacheStrategy
;
44 //TODO make private but then the Aspect class has problems !!
49 public TaxonName(INameCacheStrategy cacheStrategy
){
50 setCacheStrategy(cacheStrategy
);
53 //TODO inserted for PROTOTYPE
54 public String
getYear(){
57 public void setYear(String strYear
){
63 public INameCacheStrategy
getCacheStrategy() {
66 public void setCacheStrategy(INameCacheStrategy cacheStrategy
) {
67 this.cacheStrategy
= cacheStrategy
;
71 //The complete author string and maybe year
72 private String authorship
;
73 private String cultivarName
;
74 //The full name including author strings and maybe year
75 private String fullName
;
76 //Genus part of a name
78 private boolean hasProblem
;
79 private String idInSource
;
80 //Genus subdivision epithet
81 private String infragenericEpithet
;
82 private String infraSpecificEpithet
;
83 private boolean isAnamorphic
;
84 //alternative naming: useFullName
85 //when not set this flag protects the detailed parsed attributes from being overwritten
86 private boolean isAtomised
;
87 private boolean isBinomHybrid
;
88 private boolean isCultivarGroup
;
89 //if set: this name is a hybrid formula (a hybrid that does not have an own name) and no other hybrid flags may be set. A
90 //hybrid name may not have either an authorteam nor other name components.
91 private boolean isHybridFormula
;
92 private boolean isMonomHybrid
;
93 private boolean isTrinomHybrid
;
94 //The name without author strings and year
96 private String nameInSource
;
97 private String nomenclaturalMicroReference
;
99 private String specificEpithet
;
100 //Name of taxon when rank is above genus
101 private String uninomial
;
102 //Non-atomised addition to a name
103 private String unnamedNamePhrase
;
105 private ArrayList inverseNameRelation
;
106 private NomenclaturalCode nomenclaturalCode
;
107 private ArrayList facts
;
108 private ArrayList nameRelation
;
109 private ArrayList typeDesignations
;
110 private NomenclaturalReference nomenclaturalReference
;
111 private Source source
;
112 private Team authorTeam
;
113 private Team exAuthorTeam
;
115 public String
getAuthorship(){
119 @ManyToOne(cascade
= {CascadeType
.PERSIST
, CascadeType
.MERGE
} )
120 public Team
getAuthorTeam(){
125 public String
getCultivarName(){
129 @ManyToOne( cascade
= {CascadeType
.PERSIST
, CascadeType
.MERGE
} )
130 public Team
getExAuthorTeam(){
134 public ArrayList
getFacts(){
138 public String
getFullName(){
140 return cacheStrategy
.getFullNameCache(this);
146 public String
getGenus(){
150 public boolean getHasProblem(){
154 public String
getIdInSource(){
158 public String
getInfragenericEpithet(){
159 return infragenericEpithet
;
162 public String
getInfraSpecificEpithet(){
163 return infraSpecificEpithet
;
166 public ArrayList
getInverseNameRelation(){
167 return inverseNameRelation
;
170 public String
getName(){
172 return cacheStrategy
.getNameCache(this);
178 public String
getNameInSource(){
182 public ArrayList
getNameRelation(){
186 public NomenclaturalCode
getNomenclaturalCode(){
187 return nomenclaturalCode
;
190 public String
getNomenclaturalMicroReference(){
191 return nomenclaturalMicroReference
;
195 public NomenclaturalReference
getNomenclaturalReference(){
196 return nomenclaturalReference
;
200 public String
[] getProblems(){
204 public Rank
getRank(){
209 public Source
getSource(){
213 public String
getSpecificEpithet(){
214 return specificEpithet
;
217 public ArrayList
getTypeDesignations(){
218 return typeDesignations
;
221 public String
getUninomial(){
225 public String
getUnnamedNamePhrase(){
226 return unnamedNamePhrase
;
230 public boolean isAnamorphic(){
234 public boolean isAtomised(){
238 public boolean isBinomHybrid(){
239 return isBinomHybrid
;
242 public boolean isCultivarGroup(){
243 return isCultivarGroup
;
246 public boolean isHybridFormula(){
247 return isHybridFormula
;
250 public boolean isMonomHybrid(){
251 return isMonomHybrid
;
254 public boolean isTrinomHybrid(){
255 return isTrinomHybrid
;
262 public boolean parseName(String fullname
){
270 public void setAnamorphic(boolean newVal
){
271 isAnamorphic
= newVal
;
279 public void setAtomised(boolean newVal
){
287 public void setAuthorship(String newVal
){
295 public void setAuthorTeam(Team newVal
){
303 public void setBinomHybrid(boolean newVal
){
304 isBinomHybrid
= newVal
;
311 public void setCultivarGroup(boolean newVal
){
312 isCultivarGroup
= newVal
;
319 public void setCultivarName(String newVal
){
320 cultivarName
= newVal
;
327 public void setExAuthorTeam(Team newVal
){
328 exAuthorTeam
= newVal
;
335 public void setFacts(ArrayList newVal
){
343 public void setFullName(String newVal
){
351 public void setGenus(String newVal
){
359 public void setHasProblem(boolean newVal
){
367 public void setHybridFormula(boolean newVal
){
368 isHybridFormula
= newVal
;
375 public void setIdInSource(String newVal
){
383 public void setInfragenericEpithet(String newVal
){
384 infragenericEpithet
= newVal
;
391 public void setInfraSpecificEpithet(String newVal
){
392 infraSpecificEpithet
= newVal
;
399 public void setInverseNameRelation(ArrayList newVal
){
400 inverseNameRelation
= newVal
;
407 public void setMonomHybrid(boolean newVal
){
408 isMonomHybrid
= newVal
;
415 public void setName(String newVal
){
423 public void setNameInSource(String newVal
){
424 nameInSource
= newVal
;
431 public void setNameRelation(ArrayList newVal
){
432 nameRelation
= newVal
;
439 public void setNomenclaturalCode(NomenclaturalCode newVal
){
440 nomenclaturalCode
= newVal
;
447 public void setNomenclaturalMicroReference(String newVal
){
448 nomenclaturalMicroReference
= newVal
;
455 public void setNomenclaturalReference(NomenclaturalReference newVal
){
456 nomenclaturalReference
= newVal
;
463 public void setRank(Rank newVal
){
471 public void setSource(Source newVal
){
479 public void setSpecificEpithet(String newVal
){
480 specificEpithet
= newVal
;
487 public void setTrinomHybrid(boolean newVal
){
488 isTrinomHybrid
= newVal
;
495 public void setTypeDesignations(ArrayList newVal
){
496 //super.changeSupport.firePropertyChange("typeDesignations", typeDesignations, newVal);
497 typeDesignations
= newVal
;
504 public void setUninomial(String newVal
){
512 public void setUnnamedNamePhrase(String newVal
){
513 unnamedNamePhrase
= newVal
;