Revision e6d7b501
Added by Andreas Müller almost 7 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TaxonNameBase.java | ||
---|---|---|
56 | 56 |
import org.hibernate.search.annotations.Field; |
57 | 57 |
import org.hibernate.search.annotations.Fields; |
58 | 58 |
import org.hibernate.search.annotations.Index; |
59 |
import org.hibernate.search.annotations.Indexed; |
|
59 | 60 |
import org.hibernate.search.annotations.IndexedEmbedded; |
60 | 61 |
import org.hibernate.search.annotations.Store; |
61 | 62 |
import org.hibernate.validator.constraints.NotEmpty; |
... | ... | |
82 | 83 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
83 | 84 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
84 | 85 |
import eu.etaxonomy.cdm.strategy.cache.TaggedText; |
86 |
import eu.etaxonomy.cdm.strategy.cache.name.BacterialNameDefaultCacheStrategy; |
|
87 |
import eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy; |
|
85 | 88 |
import eu.etaxonomy.cdm.strategy.cache.name.CacheUpdate; |
86 | 89 |
import eu.etaxonomy.cdm.strategy.cache.name.INameCacheStrategy; |
87 | 90 |
import eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy; |
88 | 91 |
import eu.etaxonomy.cdm.strategy.cache.name.NonViralNameDefaultCacheStrategy; |
92 |
import eu.etaxonomy.cdm.strategy.cache.name.ZooNameDefaultCacheStrategy; |
|
89 | 93 |
import eu.etaxonomy.cdm.strategy.match.IMatchable; |
90 | 94 |
import eu.etaxonomy.cdm.strategy.match.Match; |
91 | 95 |
import eu.etaxonomy.cdm.strategy.match.Match.ReplaceMode; |
... | ... | |
95 | 99 |
import eu.etaxonomy.cdm.strategy.parser.ParserProblem; |
96 | 100 |
import eu.etaxonomy.cdm.validation.Level2; |
97 | 101 |
import eu.etaxonomy.cdm.validation.Level3; |
102 |
import eu.etaxonomy.cdm.validation.annotation.CorrectEpithetsForRank; |
|
98 | 103 |
import eu.etaxonomy.cdm.validation.annotation.NameMustFollowCode; |
104 |
import eu.etaxonomy.cdm.validation.annotation.NameMustHaveAuthority; |
|
105 |
import eu.etaxonomy.cdm.validation.annotation.NoDuplicateNames; |
|
99 | 106 |
import eu.etaxonomy.cdm.validation.annotation.NullOrNotEmpty; |
100 | 107 |
import eu.etaxonomy.cdm.validation.annotation.ValidTaxonomicYear; |
101 | 108 |
|
... | ... | |
162 | 169 |
"publicationYear", |
163 | 170 |
"originalPublicationYear", |
164 | 171 |
|
165 |
// "anamorphic",
|
|
172 |
"anamorphic", |
|
166 | 173 |
|
167 | 174 |
"cultivarName" |
168 | 175 |
}) |
... | ... | |
170 | 177 |
@Entity |
171 | 178 |
@Audited |
172 | 179 |
@Inheritance(strategy=InheritanceType.SINGLE_TABLE) |
173 |
@Table(appliesTo="TaxonNameBase", indexes = { @org.hibernate.annotations.Index(name = "taxonNameBaseTitleCacheIndex", columnNames = { "titleCache" }), @org.hibernate.annotations.Index(name = "taxonNameBaseNameCacheIndex", columnNames = { "nameCache" }) }) |
|
180 |
@Table(appliesTo="TaxonNameBase", indexes = { |
|
181 |
@org.hibernate.annotations.Index(name = "taxonNameBaseTitleCacheIndex", columnNames = { "titleCache" }), |
|
182 |
@org.hibernate.annotations.Index(name = "taxonNameBaseNameCacheIndex", columnNames = { "nameCache" }) }) |
|
174 | 183 |
@NameMustFollowCode |
175 |
public abstract class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INameCacheStrategy> |
|
184 |
@CorrectEpithetsForRank(groups = Level2.class) |
|
185 |
@NameMustHaveAuthority(groups = Level2.class) |
|
186 |
@NoDuplicateNames(groups = Level3.class) |
|
187 |
@Indexed(index = "eu.etaxonomy.cdm.model.name.TaxonNameBase") |
|
188 |
public class TaxonNameBase<T extends TaxonNameBase<?,?>, S extends INameCacheStrategy> |
|
176 | 189 |
extends IdentifiableEntity<S> |
177 | 190 |
implements ITaxonNameBase, INonViralName, IViralName, IBacterialName, IZoologicalName, |
178 |
IBotanicalName, ICultivarPlantName, |
|
191 |
IBotanicalName, ICultivarPlantName, IFungusName,
|
|
179 | 192 |
IParsable, IRelated, IMatchable, IIntextReferenceTarget, Cloneable { |
180 | 193 |
|
181 | 194 |
private static final long serialVersionUID = -791164269603409712L; |
... | ... | |
190 | 203 |
@Column(name="nameType", length=15) |
191 | 204 |
@NotNull |
192 | 205 |
@Type(type = "eu.etaxonomy.cdm.hibernate.EnumUserType", |
193 |
parameters = {@org.hibernate.annotations.Parameter(name = "enumClass", value = "eu.etaxonomy.cdm.model.name.NomenclaturalCode")}
|
|
206 |
parameters = {@org.hibernate.annotations.Parameter(name = "enumClass", value = "eu.etaxonomy.cdm.model.name.NomenclaturalCode")} |
|
194 | 207 |
) |
195 | 208 |
@Audited //needed ? |
196 | 209 |
private NomenclaturalCode nameType; |
... | ... | |
535 | 548 |
@Column(length=255) |
536 | 549 |
private String cultivarName; |
537 | 550 |
|
551 |
// ************** FUNGUS name attributes |
|
552 |
//to indicate that the type of the name is asexual or not |
|
553 |
@XmlElement(name ="IsAnamorphic") |
|
554 |
private boolean anamorphic = false; |
|
538 | 555 |
|
539 | 556 |
// *************** FACTORY METHODS ********************************/ |
540 | 557 |
|
541 | 558 |
//see TaxonNameFactory |
559 |
/** |
|
560 |
* @param code |
|
561 |
* @param rank |
|
562 |
* @param homotypicalGroup |
|
563 |
* @return |
|
564 |
*/ |
|
565 |
protected static TaxonNameBase NewInstance(NomenclaturalCode code, Rank rank, |
|
566 |
HomotypicalGroup homotypicalGroup) { |
|
567 |
TaxonNameBase<?,?> result = new TaxonNameBase<>(code, rank, homotypicalGroup); |
|
568 |
return result; |
|
569 |
} |
|
542 | 570 |
|
543 | 571 |
|
544 |
// ************* CONSTRUCTORS *************/ |
|
545 | 572 |
/** |
546 |
* Class constructor: creates a new empty taxon name. |
|
547 |
* @param code |
|
548 |
* |
|
549 |
* @see #TaxonNameBase(Rank) |
|
550 |
* @see #TaxonNameBase(HomotypicalGroup) |
|
551 |
* @see #TaxonNameBase(Rank, HomotypicalGroup) |
|
573 |
* @param icnafp |
|
574 |
* @param rank2 |
|
575 |
* @param genusOrUninomial2 |
|
576 |
* @param infraGenericEpithet2 |
|
577 |
* @param specificEpithet2 |
|
578 |
* @param infraSpecificEpithet2 |
|
579 |
* @param combinationAuthorship2 |
|
580 |
* @param nomenclaturalReference2 |
|
581 |
* @param nomenclMicroRef |
|
582 |
* @param homotypicalGroup2 |
|
583 |
* @return |
|
552 | 584 |
*/ |
553 |
protected TaxonNameBase() { |
|
554 |
super(); |
|
555 |
setNameCacheStrategy(); |
|
585 |
public static TaxonNameBase NewInstance(NomenclaturalCode code, Rank rank, String genusOrUninomial, |
|
586 |
String infraGenericEpithet, String specificEpithet, String infraSpecificEpithet, |
|
587 |
TeamOrPersonBase combinationAuthorship, Reference nomenclaturalReference, |
|
588 |
String nomenclMicroRef, HomotypicalGroup homotypicalGroup) { |
|
589 |
TaxonNameBase result = new TaxonNameBase<>(code, rank, genusOrUninomial, infraGenericEpithet, specificEpithet, infraSpecificEpithet, combinationAuthorship, nomenclaturalReference, nomenclMicroRef, homotypicalGroup); |
|
590 |
return result; |
|
556 | 591 |
} |
592 |
|
|
593 |
|
|
594 |
// ************* CONSTRUCTORS *************/ |
|
557 | 595 |
/** |
558 | 596 |
* Class constructor: creates a new empty taxon name. |
559 | 597 |
* @param code |
... | ... | |
562 | 600 |
* @see #TaxonNameBase(HomotypicalGroup) |
563 | 601 |
* @see #TaxonNameBase(Rank, HomotypicalGroup) |
564 | 602 |
*/ |
565 |
protected TaxonNameBase(NomenclaturalCode type) {
|
|
603 |
protected TaxonNameBase() { |
|
566 | 604 |
super(); |
567 |
this.nameType = type; |
|
568 | 605 |
setNameCacheStrategy(); |
569 | 606 |
} |
570 |
/** |
|
571 |
* Class constructor: creates a new taxon name |
|
572 |
* only containing its {@link Rank rank}. |
|
573 |
* |
|
574 |
* @param rank the rank to be assigned to <i>this</i> taxon name |
|
575 |
* @see #TaxonNameBase() |
|
576 |
* @see #TaxonNameBase(HomotypicalGroup) |
|
577 |
* @see #TaxonNameBase(Rank, HomotypicalGroup) |
|
578 |
*/ |
|
579 |
protected TaxonNameBase(NomenclaturalCode code, Rank rank) { |
|
580 |
this(code, rank, null); |
|
581 |
} |
|
582 |
/** |
|
583 |
* Class constructor: creates a new taxon name instance |
|
584 |
* only containing its {@link HomotypicalGroup homotypical group}. |
|
585 |
* The new taxon name will be also added to the set of taxon names |
|
586 |
* belonging to this homotypical group. |
|
587 |
* |
|
588 |
* @param homotypicalGroup the homotypical group to which <i>this</i> taxon name belongs |
|
589 |
* @see #TaxonNameBase() |
|
590 |
* @see #TaxonNameBase(Rank) |
|
591 |
* @see #TaxonNameBase(Rank, HomotypicalGroup) |
|
592 |
*/ |
|
593 |
protected TaxonNameBase(NomenclaturalCode type, HomotypicalGroup homotypicalGroup) { |
|
594 |
this(type, null, homotypicalGroup); |
|
595 |
} |
|
607 |
|
|
596 | 608 |
|
597 | 609 |
/** |
598 | 610 |
* Class constructor: creates a new taxon name instance |
... | ... | |
610 | 622 |
*/ |
611 | 623 |
protected TaxonNameBase(NomenclaturalCode type, Rank rank, HomotypicalGroup homotypicalGroup) { |
612 | 624 |
super(); |
613 |
this.nameType = type;
|
|
625 |
setNameType(type);
|
|
614 | 626 |
this.setRank(rank); |
615 | 627 |
if (homotypicalGroup == null){ |
616 |
homotypicalGroup = new HomotypicalGroup();
|
|
628 |
homotypicalGroup = HomotypicalGroup.NewInstance();
|
|
617 | 629 |
} |
618 | 630 |
homotypicalGroup.addTypifiedName(this); |
619 | 631 |
this.homotypicalGroup = homotypicalGroup; |
... | ... | |
666 | 678 |
|
667 | 679 |
|
668 | 680 |
private void setNameCacheStrategy(){ |
669 |
if (getClass() == NonViralName.class){ |
|
681 |
if (getNameType() == null){ |
|
682 |
this.cacheStrategy = null; |
|
683 |
}else if (this.cacheStrategy != null){ |
|
684 |
// |
|
685 |
}else if (getNameType() == NomenclaturalCode.NonViral){ |
|
670 | 686 |
this.cacheStrategy = (S)NonViralNameDefaultCacheStrategy.NewInstance(); |
687 |
}else if (getNameType().isBotanical()){ |
|
688 |
this.cacheStrategy = (S)BotanicNameDefaultCacheStrategy.NewInstance(); |
|
689 |
}else if (getNameType() == NomenclaturalCode.ICZN){ |
|
690 |
this.cacheStrategy = (S)ZooNameDefaultCacheStrategy.NewInstance(); |
|
691 |
}else if (getNameType() == NomenclaturalCode.ICNB){ |
|
692 |
this.cacheStrategy = (S)BacterialNameDefaultCacheStrategy.NewInstance();; |
|
693 |
}else if (getNameType() == NomenclaturalCode.ICVCN){ |
|
694 |
this.cacheStrategy = super.getCacheStrategy(); |
|
671 | 695 |
} |
672 | 696 |
} |
673 | 697 |
|
... | ... | |
776 | 800 |
|
777 | 801 |
// ****************** GETTER / SETTER ****************************/ |
778 | 802 |
|
803 |
@Override |
|
804 |
public NomenclaturalCode getNameType() { |
|
805 |
return nameType; |
|
806 |
} |
|
807 |
|
|
808 |
@Override |
|
809 |
public void setNameType(NomenclaturalCode nameType) { |
|
810 |
this.nameType = nameType; |
|
811 |
setNameCacheStrategy(); |
|
812 |
} |
|
813 |
|
|
779 | 814 |
/** |
780 | 815 |
* Returns the boolean value of the flag intended to protect (true) |
781 | 816 |
* or not (false) the {@link #getNameCache() nameCache} (scientific name without author strings and year) |
... | ... | |
1148 | 1183 |
this.binomHybrid = binomHybrid; |
1149 | 1184 |
} |
1150 | 1185 |
|
1151 |
/** |
|
1152 |
* Returns the boolean value of the flag indicating whether <i>this</i> botanical |
|
1153 |
* taxon name is the name of an infraspecific hybrid (true) or not (false). |
|
1154 |
* In this case the term "notho-" (optionally abbreviated "n-") is used as |
|
1155 |
* a prefix to the term denoting the infraspecific rank of <i>this</i> botanical |
|
1156 |
* taxon name. If this flag is set no other hybrid flags may be set. |
|
1157 |
* |
|
1158 |
* @return the boolean value of the isTrinomHybrid flag |
|
1159 |
* @see #isHybridFormula() |
|
1160 |
* @see #isMonomHybrid() |
|
1161 |
* @see #isBinomHybrid() |
|
1162 |
*/ |
|
1163 | 1186 |
@Override |
1164 | 1187 |
public boolean isTrinomHybrid(){ |
1165 | 1188 |
return this.trinomHybrid; |
... | ... | |
1177 | 1200 |
|
1178 | 1201 |
// ****************** VIRAL NAME ******************/ |
1179 | 1202 |
|
1180 |
/** |
|
1181 |
* Returns the accepted acronym (an assigned abbreviation) string for <i>this</i> |
|
1182 |
* viral taxon name. For instance PCV stays for Peanut Clump Virus. |
|
1183 |
* |
|
1184 |
* @return the string containing the accepted acronym of <i>this</i> viral taxon name |
|
1185 |
*/ |
|
1186 | 1203 |
@Override |
1187 | 1204 |
public String getAcronym(){ |
1188 | 1205 |
return this.acronym; |
... | ... | |
1198 | 1215 |
|
1199 | 1216 |
// ****************** BACTERIAL NAME ******************/ |
1200 | 1217 |
|
1201 |
/** |
|
1202 |
* Returns the string containing the authorship with the year and details |
|
1203 |
* of the reference in which the subgenus included in the scientific name |
|
1204 |
* of <i>this</i> bacterial taxon name was published. |
|
1205 |
* For instance if the bacterial taxon name is |
|
1206 |
* 'Bacillus (subgen. Aerobacillus Donker 1926, 128) polymyxa' the subgenus |
|
1207 |
* authorship string is 'Donker 1926, 128'. |
|
1208 |
* |
|
1209 |
* @return the string containing the complete subgenus' authorship |
|
1210 |
* included in <i>this</i> bacterial taxon name |
|
1211 |
*/ |
|
1212 | 1218 |
@Override |
1213 | 1219 |
public String getSubGenusAuthorship(){ |
1214 | 1220 |
return this.subGenusAuthorship; |
1215 | 1221 |
} |
1216 | 1222 |
|
1217 |
/** |
|
1218 |
* @see #getSubGenusAuthorship() |
|
1219 |
*/ |
|
1220 | 1223 |
@Override |
1221 | 1224 |
public void setSubGenusAuthorship(String subGenusAuthorship){ |
1222 | 1225 |
this.subGenusAuthorship = subGenusAuthorship; |
1223 | 1226 |
} |
1224 | 1227 |
|
1225 |
/** |
|
1226 |
* Returns the string representing the reason for the approbation of <i>this</i> |
|
1227 |
* bacterial taxon name. Bacterial taxon names are valid or approved |
|
1228 |
* according to: |
|
1229 |
* <ul> |
|
1230 |
* <li>the approved list, c.f.r. IJSB 1980 (AL) |
|
1231 |
* <li>the validation list, in IJSB after 1980 (VL) |
|
1232 |
* </ul> |
|
1233 |
* or |
|
1234 |
* <ul> |
|
1235 |
* <li>are validly published as paper in IJSB after 1980 (VP). |
|
1236 |
* </ul> |
|
1237 |
* IJSB is the acronym for International Journal of Systematic Bacteriology. |
|
1238 |
* |
|
1239 |
* @return the string with the source of the approbation for <i>this</i> bacterial taxon name |
|
1240 |
*/ |
|
1228 |
|
|
1241 | 1229 |
@Override |
1242 | 1230 |
public String getNameApprobation(){ |
1243 | 1231 |
return this.nameApprobation; |
... | ... | |
1253 | 1241 |
|
1254 | 1242 |
//************ Zoological Name |
1255 | 1243 |
|
1256 |
/** |
|
1257 |
* Returns the breed name string for <i>this</i> animal (zoological taxon name). |
|
1258 |
* |
|
1259 |
* @return the string containing the breed name for <i>this</i> zoological taxon name |
|
1260 |
*/ |
|
1244 |
|
|
1261 | 1245 |
@Override |
1262 | 1246 |
public String getBreed(){ |
1263 | 1247 |
return this.breed; |
... | ... | |
1270 | 1254 |
this.breed = StringUtils.isBlank(breed) ? null : breed; |
1271 | 1255 |
} |
1272 | 1256 |
|
1273 |
/** |
|
1274 |
* Returns the publication year (as an integer) for <i>this</i> zoological taxon |
|
1275 |
* name. If the publicationYear attribute is null and a nomenclatural |
|
1276 |
* reference exists the year could be computed from the |
|
1277 |
* {@link eu.etaxonomy.cdm.reference.INomenclaturalReference nomenclatural reference}. |
|
1278 |
* |
|
1279 |
* @return the integer representing the publication year for <i>this</i> zoological taxon name |
|
1280 |
* @see #getOriginalPublicationYear() |
|
1281 |
*/ |
|
1257 |
|
|
1282 | 1258 |
@Override |
1283 | 1259 |
public Integer getPublicationYear() { |
1284 | 1260 |
return publicationYear; |
... | ... | |
1291 | 1267 |
this.publicationYear = publicationYear; |
1292 | 1268 |
} |
1293 | 1269 |
|
1294 |
/** |
|
1295 |
* Returns the publication year (as an integer) of the original validly |
|
1296 |
* published species epithet for <i>this</i> zoological taxon name. This only |
|
1297 |
* applies for zoological taxon names that are no {@link TaxonNameBase#isOriginalCombination() original combinations}. |
|
1298 |
* If the originalPublicationYear attribute is null the year could be taken |
|
1299 |
* from the publication year of the corresponding original name (basionym) |
|
1300 |
* or from the {@link eu.etaxonomy.cdm.reference.INomenclaturalReference nomenclatural reference} of the basionym |
|
1301 |
* if it exists. |
|
1302 |
* |
|
1303 |
* @return the integer representing the publication year of the original |
|
1304 |
* species epithet corresponding to <i>this</i> zoological taxon name |
|
1305 |
* @see #getPublicationYear() |
|
1306 |
*/ |
|
1270 |
|
|
1307 | 1271 |
@Override |
1308 | 1272 |
public Integer getOriginalPublicationYear() { |
1309 | 1273 |
return originalPublicationYear; |
... | ... | |
1318 | 1282 |
|
1319 | 1283 |
// **** Cultivar Name ************ |
1320 | 1284 |
|
1321 |
/** |
|
1322 |
* Returns the characteristical cultivar name part string assigned to <i>this</i> |
|
1323 |
* cultivar taxon name. In the scientific name "Clematis alpina 'Ruby'" for |
|
1324 |
* instance this characteristical string is "Ruby". This part of the name is |
|
1325 |
* governed by the International Code for the Nomenclature of Cultivated |
|
1326 |
* Plants and the string should include neither quotes nor + signs |
|
1327 |
* (these elements of the name cache string will be generated by the |
|
1328 |
* {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}). |
|
1329 |
*/ |
|
1285 |
|
|
1330 | 1286 |
@Override |
1331 | 1287 |
public String getCultivarName(){ |
1332 | 1288 |
return this.cultivarName; |
... | ... | |
1340 | 1296 |
this.cultivarName = StringUtils.isBlank(cultivarName) ? null : cultivarName; |
1341 | 1297 |
} |
1342 | 1298 |
|
1299 |
// **************** Fungus Name |
|
1300 |
@Override |
|
1301 |
public boolean isAnamorphic(){ |
|
1302 |
return this.anamorphic; |
|
1303 |
} |
|
1304 |
|
|
1305 |
/** |
|
1306 |
* @see #isAnamorphic() |
|
1307 |
*/ |
|
1308 |
@Override |
|
1309 |
public void setAnamorphic(boolean anamorphic){ |
|
1310 |
this.anamorphic = anamorphic; |
|
1311 |
} |
|
1312 |
|
|
1343 | 1313 |
|
1344 | 1314 |
// **************** ADDER / REMOVE *************************/ |
1345 | 1315 |
|
... | ... | |
1406 | 1376 |
|
1407 | 1377 |
//********* METHODS **************************************/ |
1408 | 1378 |
|
1379 |
@Override |
|
1380 |
public S getCacheStrategy() { |
|
1381 |
setNameCacheStrategy(); |
|
1382 |
return this.cacheStrategy; |
|
1383 |
} |
|
1384 |
|
|
1409 | 1385 |
@Override |
1410 | 1386 |
public String generateFullTitle(){ |
1411 |
if (cacheStrategy == null){
|
|
1387 |
if (getCacheStrategy() == null){
|
|
1412 | 1388 |
logger.warn("No CacheStrategy defined for taxon name: " + this.getUuid()); |
1413 | 1389 |
return null; |
1414 | 1390 |
}else{ |
... | ... | |
1429 | 1405 |
this.setProtectedFullTitleCache(protectCache); |
1430 | 1406 |
} |
1431 | 1407 |
|
1432 |
/** |
|
1433 |
* Needs to be implemented by those classes that handle autonyms (e.g. botanical names). |
|
1434 |
**/ |
|
1408 |
/** Checks if this name is an autonym.<BR> |
|
1409 |
* An autonym is a taxon name that has equal specific and infra specific epithets.<BR> |
|
1410 |
* {@link http://ibot.sav.sk/icbn/frameset/0010Ch2Sec1a006.htm#6.8. Vienna Code §6.8} |
|
1411 |
* or a taxon name that has equal generic and infrageneric epithets (A22.2).<BR> |
|
1412 |
* Only relevant for botanical names. |
|
1413 |
* @return true, if name has Rank, Rank is below species and species epithet equals infraSpeciesEpithtet, else false |
|
1414 |
*/ |
|
1435 | 1415 |
@Override |
1436 | 1416 |
@Transient |
1437 | 1417 |
public boolean isAutonym(){ |
1438 |
return false; |
|
1418 |
if (isBotanical()){ |
|
1419 |
if (this.getRank() != null && this.getSpecificEpithet() != null && this.getInfraSpecificEpithet() != null && |
|
1420 |
this.isInfraSpecific() && this.getSpecificEpithet().trim().equals(this.getInfraSpecificEpithet().trim())){ |
|
1421 |
return true; |
|
1422 |
}else if (this.getRank() != null && this.getGenusOrUninomial() != null && this.getInfraGenericEpithet() != null && |
|
1423 |
this.isInfraGeneric() && this.getGenusOrUninomial().trim().equals(this.getInfraGenericEpithet().trim())){ |
|
1424 |
return true; |
|
1425 |
}else{ |
|
1426 |
return false; |
|
1427 |
} |
|
1428 |
}else{ |
|
1429 |
return false; |
|
1430 |
} |
|
1439 | 1431 |
} |
1440 | 1432 |
|
1433 |
|
|
1441 | 1434 |
@Override |
1442 | 1435 |
@Transient |
1443 | 1436 |
public List<TaggedText> getTaggedName(){ |
... | ... | |
1555 | 1548 |
*/ |
1556 | 1549 |
@Override |
1557 | 1550 |
public String generateAuthorship(){ |
1558 |
if (cacheStrategy == null){
|
|
1551 |
if (getCacheStrategy() == null){
|
|
1559 | 1552 |
logger.warn("No CacheStrategy defined for taxon name: " + this.getUuid()); |
1560 | 1553 |
return null; |
1561 | 1554 |
}else{ |
... | ... | |
1921 | 1914 |
* @see #getNameCache() |
1922 | 1915 |
*/ |
1923 | 1916 |
protected String generateNameCache(){ |
1924 |
if (cacheStrategy == null){
|
|
1917 |
if (getCacheStrategy() == null){
|
|
1925 | 1918 |
logger.warn("No CacheStrategy defined for taxon name: " + this.toString()); |
1926 | 1919 |
return null; |
1927 | 1920 |
}else{ |
... | ... | |
3140 | 3133 |
* @return null |
3141 | 3134 |
* @see #isCodeCompliant() |
3142 | 3135 |
* @see #getHasProblem() |
3136 |
* @deprecated use {@link #getNameType()} instead |
|
3143 | 3137 |
*/ |
3144 | 3138 |
@Override |
3139 |
@Deprecated |
|
3140 |
@Transient |
|
3141 |
@java.beans.Transient |
|
3145 | 3142 |
public NomenclaturalCode getNomenclaturalCode() { |
3146 |
logger.warn("TaxonNameBase has no specific Code defined. Use subclasses"); |
|
3147 |
return null; |
|
3143 |
return nameType; |
|
3148 | 3144 |
} |
3149 | 3145 |
|
3150 | 3146 |
|
... | ... | |
3535 | 3531 |
|
3536 | 3532 |
} |
3537 | 3533 |
|
3534 |
/** |
|
3535 |
* @return |
|
3536 |
*/ |
|
3537 |
@Override |
|
3538 |
public boolean isNonViral() { |
|
3539 |
return nameType.isNonViral(); |
|
3540 |
} |
|
3541 |
|
|
3542 |
@Override |
|
3543 |
public boolean isZoological(){ |
|
3544 |
return nameType.isZoological(); |
|
3545 |
} |
|
3546 |
@Override |
|
3547 |
public boolean isBotanical() { |
|
3548 |
return nameType.isBotanical(); |
|
3549 |
} |
|
3550 |
@Override |
|
3551 |
public boolean isCultivar() { |
|
3552 |
return nameType.isCultivar(); |
|
3553 |
} |
|
3554 |
@Override |
|
3555 |
public boolean isBacterial() { |
|
3556 |
return nameType.isBacterial(); |
|
3557 |
} |
|
3558 |
@Override |
|
3559 |
public boolean isViral() { |
|
3560 |
return nameType.isViral(); |
|
3561 |
} |
|
3562 |
|
|
3538 | 3563 |
} |
Also available in: Unified diff
ref #6368 remove TaxonNameBase subclasses