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 javax
.persistence
.Entity
;
14 import javax
.persistence
.Transient
;
15 import javax
.xml
.bind
.annotation
.XmlAccessType
;
16 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
17 import javax
.xml
.bind
.annotation
.XmlElement
;
18 import javax
.xml
.bind
.annotation
.XmlRootElement
;
19 import javax
.xml
.bind
.annotation
.XmlTransient
;
20 import javax
.xml
.bind
.annotation
.XmlType
;
22 import org
.apache
.log4j
.Logger
;
24 import eu
.etaxonomy
.cdm
.strategy
.cache
.name
.INameCacheStrategy
;
27 * The taxon name class for viral taxa. The scientific name will be stored
28 * as a string (consisting eventually of several words even combined also with
29 * non alphabetical characters) in the inherited {@link eu.etaxonomy.cdm.model.common.IdentifiableEntity#setTitleCache(String) titleCache} attribute.
30 * Classification has no influence on the names of viral taxon names and no
31 * viral taxon must be taxonomically included in another viral taxon with
32 * higher rank. For examples see ICTVdb:
33 * "http://www.ncbi.nlm.nih.gov/ICTVdb/Ictv/vn_indxA.htm"
35 * This class corresponds to: NameViral according to the ABCD schema.
39 * @created 08-Nov-2007 13:07:02
41 @XmlAccessorType(XmlAccessType
.FIELD
)
42 @XmlType(name
= "", propOrder
= {
45 @XmlRootElement(name
= "ViralName")
48 public class ViralName
extends TaxonNameBase
<ViralName
, INameCacheStrategy
<ViralName
>> {
50 private static final Logger logger
= Logger
.getLogger(ViralName
.class);
53 protected INameCacheStrategy
<ViralName
> cacheStrategy
;
55 @XmlElement(name
= "Acronym")
56 private String acronym
;
58 // ************* CONSTRUCTORS *************/
60 protected ViralName(){
65 * Class constructor: creates a new viral taxon name instance
66 * only containing its {@link Rank rank}.
68 * @param rank the rank to be assigned to <i>this</i> viral taxon name
69 * @see TaxonNameBase#TaxonNameBase(Rank)
71 public ViralName(Rank rank
) {
76 //********* METHODS **************************************/
79 * Creates a new viral taxon name instance only containing its {@link Rank rank}.
81 * @param rank the rank to be assigned to <i>this</i> viral taxon name
82 * @see #ViralName(Rank)
84 public static ViralName
NewInstance(Rank rank
){
85 return new ViralName(rank
);
89 * Returns the accepted acronym (an assigned abbreviation) string for <i>this</i>
90 * viral taxon name. For instance PCV stays for Peanut Clump Virus.
92 * @return the string containing the accepted acronym of <i>this</i> viral taxon name
94 public String
getAcronym(){
100 public void setAcronym(String acronym
){
101 this.acronym
= acronym
;
105 * Generates and returns the string with the scientific name of <i>this</i>
106 * viral taxon name. This string may be stored in the inherited
107 * {@link eu.etaxonomy.cdm.model.common.IdentifiableEntity#getTitleCache() titleCache} attribute.
108 * This method overrides the generic and inherited
109 * method from {@link TaxonNameBase TaxonNameBase} .
111 * @return the string with the composed name of <i>this</i> viral taxon name with authorship (and maybe year)
112 * @see eu.etaxonomy.cdm.model.common.IdentifiableEntity#generateTitle()
113 * @see eu.etaxonomy.cdm.model.common.IdentifiableEntity#getTitleCache()
114 * @see TaxonNameBase#generateTitle()
117 public String
generateTitle(){
118 logger
.warn("not yet implemented");
119 return this.toString();
123 public String
generateFullTitle(){
124 logger
.warn("not yet implemented");
125 return this.toString();
129 * Returns the boolean value "true" if the components of <i>this</i> viral taxon name
130 * follow the rules of the corresponding
131 * {@link NomenclaturalCode International Code of Virus Classification and Nomenclature},
133 * This method overrides and implements the isCodeCompliant method from
134 * the abstract {@link TaxonNameBase#isCodeCompliant() TaxonNameBase} class.
136 * @return the boolean value expressing the compliance of <i>this</i> viral taxon name to its nomenclatural code
137 * @see TaxonNameBase#isCodeCompliant()
141 public boolean isCodeCompliant() {
142 logger
.warn("not yet implemented");
148 * Returns the {@link NomenclaturalCode nomenclatural code} that governs
149 * the construction of <i>this</i> viral taxon name, that is the
150 * International Code of Virus Classification and Nomenclature.
151 * This method overrides the getNomeclaturalCode method from {@link TaxonNameBase TaxonNameBase}.
153 * @return the nomenclatural code for viruses
154 * @see #isCodeCompliant()
155 * @see TaxonNameBase#getHasProblem()
156 * @see TaxonNameBase#getNomenclaturalCode()
160 public NomenclaturalCode
getNomenclaturalCode(){
161 return NomenclaturalCode
.ICVCN
;
166 * Returns the {@link eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy cache strategy} used to generate
167 * several strings corresponding to <i>this</i> viral taxon name.
169 * @return the cache strategy used for <i>this</i> viral taxon name
170 * @see eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy
171 * @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy
175 public INameCacheStrategy
getCacheStrategy() {
176 return cacheStrategy
;
181 * @see #getCacheStrategy()
184 public void setCacheStrategy(INameCacheStrategy cacheStrategy
) {
185 this.cacheStrategy
= cacheStrategy
;