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 org
.apache
.log4j
.Logger
;
15 import eu
.etaxonomy
.cdm
.strategy
.cache
.name
.INameCacheStrategy
;
16 import javax
.persistence
.*;
17 import javax
.xml
.bind
.annotation
.XmlAccessType
;
18 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
19 import javax
.xml
.bind
.annotation
.XmlElement
;
20 import javax
.xml
.bind
.annotation
.XmlRootElement
;
21 import javax
.xml
.bind
.annotation
.XmlTransient
;
22 import javax
.xml
.bind
.annotation
.XmlType
;
25 * The taxon name class for viral taxa. The scientific name will be stored
26 * as a string (consisting eventually of several words even combined also with
27 * non alphabetical characters) in the inherited {@link eu.etaxonomy.cdm.model.common.IdentifiableEntity#setTitleCache(String) titleCache} attribute.
28 * Classification has no influence on the names of viral taxon names and no
29 * viral taxon must be taxonomically included in another viral taxon with
30 * higher rank. For examples see ICTVdb:
31 * "http://www.ncbi.nlm.nih.gov/ICTVdb/Ictv/vn_indxA.htm"
33 * This class corresponds to: NameViral according to the ABCD schema.
37 * @created 08-Nov-2007 13:07:02
39 @XmlAccessorType(XmlAccessType
.FIELD
)
40 @XmlType(name
= "", propOrder
= {
43 @XmlRootElement(name
= "ViralName")
45 public class ViralName
extends TaxonNameBase
<ViralName
, INameCacheStrategy
> {
47 private static final Logger logger
= Logger
.getLogger(ViralName
.class);
50 protected INameCacheStrategy cacheStrategy
;
52 @XmlElement(name
= "Acronym")
53 private String acronym
;
55 // ************* CONSTRUCTORS *************/
57 protected ViralName(){
62 * Class constructor: creates a new viral taxon name instance
63 * only containing its {@link Rank rank}.
65 * @param rank the rank to be assigned to <i>this</i> viral taxon name
66 * @see TaxonNameBase#TaxonNameBase(Rank)
68 public ViralName(Rank rank
) {
73 //********* METHODS **************************************/
76 * Creates a new viral taxon name instance only containing its {@link Rank rank}.
78 * @param rank the rank to be assigned to <i>this</i> viral taxon name
79 * @see #ViralName(Rank)
81 public static ViralName
NewInstance(Rank rank
){
82 return new ViralName(rank
);
86 * Returns the accepted acronym (an assigned abbreviation) string for <i>this</i>
87 * viral taxon name. For instance PCV stays for Peanut Clump Virus.
89 * @return the string containing the accepted acronym of <i>this</i> viral taxon name
91 public String
getAcronym(){
97 public void setAcronym(String acronym
){
98 this.acronym
= acronym
;
102 * Generates and returns the string with the scientific name of <i>this</i>
103 * viral taxon name. This string may be stored in the inherited
104 * {@link eu.etaxonomy.cdm.model.common.IdentifiableEntity#getTitleCache() titleCache} attribute.
105 * This method overrides the generic and inherited
106 * method from {@link TaxonNameBase TaxonNameBase} .
108 * @return the string with the composed name of <i>this</i> viral taxon name with authorship (and maybe year)
109 * @see eu.etaxonomy.cdm.model.common.IdentifiableEntity#generateTitle()
110 * @see eu.etaxonomy.cdm.model.common.IdentifiableEntity#getTitleCache()
111 * @see TaxonNameBase#generateTitle()
114 public String
generateTitle(){
115 logger
.warn("not yet implemented");
116 return this.toString();
120 public String
generateFullTitle(){
121 logger
.warn("not yet implemented");
122 return this.toString();
126 * Returns the boolean value "true" if the components of <i>this</i> viral taxon name
127 * follow the rules of the corresponding
128 * {@link NomenclaturalCode International Code of Virus Classification and Nomenclature},
130 * This method overrides and implements the isCodeCompliant method from
131 * the abstract {@link TaxonNameBase#isCodeCompliant() TaxonNameBase} class.
133 * @return the boolean value expressing the compliance of <i>this</i> viral taxon name to its nomenclatural code
134 * @see TaxonNameBase#isCodeCompliant()
138 public boolean isCodeCompliant() {
139 logger
.warn("not yet implemented");
145 * Returns the {@link NomenclaturalCode nomenclatural code} that governs
146 * the construction of <i>this</i> viral taxon name, that is the
147 * International Code of Virus Classification and Nomenclature.
148 * This method overrides the getNomeclaturalCode method from {@link TaxonNameBase TaxonNameBase}.
150 * @return the nomenclatural code for viruses
151 * @see #isCodeCompliant()
152 * @see TaxonNameBase#getHasProblem()
153 * @see TaxonNameBase#getNomenclaturalCode()
157 public NomenclaturalCode
getNomenclaturalCode(){
158 return NomenclaturalCode
.ICVCN();
163 * Returns the {@link eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy cache strategy} used to generate
164 * several strings corresponding to <i>this</i> viral taxon name.
166 * @return the cache strategy used for <i>this</i> viral taxon name
167 * @see eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy
168 * @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy
172 public INameCacheStrategy
getCacheStrategy() {
173 return cacheStrategy
;
178 * @see #getCacheStrategy()
181 public void setCacheStrategy(INameCacheStrategy cacheStrategy
) {
182 this.cacheStrategy
= cacheStrategy
;