Revision d7919b1c
Added by Andreas Müller about 7 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/taxonx2013/TaxonXTreatmentExtractor.java | ||
---|---|---|
49 | 49 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
50 | 50 |
import eu.etaxonomy.cdm.model.description.TaxonNameDescription; |
51 | 51 |
import eu.etaxonomy.cdm.model.description.TextData; |
52 |
import eu.etaxonomy.cdm.model.name.BacterialName; |
|
53 |
import eu.etaxonomy.cdm.model.name.BotanicalName; |
|
54 | 52 |
import eu.etaxonomy.cdm.model.name.INonViralName; |
55 | 53 |
import eu.etaxonomy.cdm.model.name.ITaxonNameBase; |
56 | 54 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
57 | 55 |
import eu.etaxonomy.cdm.model.name.NomenclaturalStatus; |
58 | 56 |
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType; |
59 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
|
60 | 57 |
import eu.etaxonomy.cdm.model.name.Rank; |
61 | 58 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
62 | 59 |
import eu.etaxonomy.cdm.model.name.ZoologicalName; |
... | ... | |
1587 | 1584 |
} |
1588 | 1585 |
|
1589 | 1586 |
|
1590 |
private boolean addFollowingTextToName(TaxonNameBase nameToBeFilled, String followingText) { |
|
1587 |
private boolean addFollowingTextToName(ITaxonNameBase nameToBeFilled, String followingText) {
|
|
1591 | 1588 |
if (nameToBeFilled != null && StringUtils.isNotBlank(followingText)){ |
1592 | 1589 |
if (! followingText.matches("\\d\\.?")){ |
1593 | 1590 |
|
... | ... | |
1617 | 1614 |
acceptedTaxon = CdmBase.deproxy(acceptedTaxon, Taxon.class); |
1618 | 1615 |
|
1619 | 1616 |
NodeList children = refgroup.getChildNodes(); |
1620 |
NonViralName<?> nameToBeFilled = getNonViralNameAccNomenclature();
|
|
1617 |
INonViralName nameToBeFilled = getNonViralNameAccNomenclature();
|
|
1621 | 1618 |
|
1622 | 1619 |
ReferenceBuilder refBuild = new ReferenceBuilder(sourceHandler); |
1623 | 1620 |
for (int i=0;i<children.getLength();i++){ |
... | ... | |
1665 | 1662 |
* @return |
1666 | 1663 |
*/ |
1667 | 1664 |
|
1668 |
private NonViralName<?> getNonViralNameAccNomenclature() {
|
|
1669 |
return (NonViralName<?>)nomenclaturalCode.getNewTaxonNameInstance(null);
|
|
1665 |
private INonViralName getNonViralNameAccNomenclature() {
|
|
1666 |
return nomenclaturalCode.getNewTaxonNameInstance(null); |
|
1670 | 1667 |
} |
1671 | 1668 |
|
1672 | 1669 |
/** |
... | ... | |
1692 | 1689 |
* handle cases where the bibref are inside <p> and outside |
1693 | 1690 |
*/ |
1694 | 1691 |
@SuppressWarnings("rawtypes") |
1695 |
private void extractReferenceRawText(NodeList references, NonViralName<?> nameToBeFilled, Reference refMods,
|
|
1692 |
private void extractReferenceRawText(NodeList references, INonViralName nameToBeFilled, Reference refMods,
|
|
1696 | 1693 |
Taxon acceptedTaxon) { |
1697 | 1694 |
logger.info("extractReferenceRawText"); |
1698 | 1695 |
String refString=""; |
... | ... | |
1975 | 1972 |
nameTBF = TaxonNameFactory.NewBotanicalInstance(null); |
1976 | 1973 |
} |
1977 | 1974 |
if (nomenclaturalCode.equals(NomenclaturalCode.ICZN)){ |
1978 |
nameTBF = ZoologicalName.NewInstance(null);
|
|
1975 |
nameTBF = TaxonNameFactory.NewZoologicalInstance(null);
|
|
1979 | 1976 |
} |
1980 | 1977 |
if (nomenclaturalCode.equals(NomenclaturalCode.ICNB)){ |
1981 |
nameTBF= BacterialName.NewInstance(null);
|
|
1978 |
nameTBF= TaxonNameFactory.NewBacterialInstance(null);
|
|
1982 | 1979 |
} |
1983 | 1980 |
parser.parseReferencedName(nameTBF, fullname, rank, false); |
1984 | 1981 |
retry++; |
... | ... | |
2093 | 2090 |
// System.out.println("COLLECTION EVENT INSIDE NOMENCLATURE"); |
2094 | 2091 |
extractMaterialsDirect(childNode, acceptedTaxon, refMods, "collection", currentMyName.getTaxonNameBase()); |
2095 | 2092 |
}else if(childName.equalsIgnoreCase("tax:name")){ |
2096 |
NonViralName<?> nameToBeFilled;
|
|
2093 |
INonViralName nameToBeFilled;
|
|
2097 | 2094 |
//System.out.println("HANDLE FIRST NAME OF THE LIST"); |
2098 | 2095 |
if(!containsSynonyms){ |
2099 | 2096 |
wasSynonym = false; |
... | ... | |
2220 | 2217 |
}else if (childName.equalsIgnoreCase("tax:bibref")){ |
2221 | 2218 |
logger.warn(childName + " still preliminary"); |
2222 | 2219 |
|
2223 |
NonViralName<?> currentName = currentMyName == null ? null : currentMyName.getTaxonNameBase();
|
|
2220 |
INonViralName currentName = currentMyName == null ? null : currentMyName.getTaxonNameBase();
|
|
2224 | 2221 |
boolean handled = addFollowingTextToName (currentName, childNode.getTextContent() ); |
2225 | 2222 |
if (! handled){ |
2226 | 2223 |
setParticularDescription(freetext.trim(), acceptedTaxon,acceptedTaxon, refMods, getNotMarkedUpFeatureObject()); |
... | ... | |
2230 | 2227 |
} |
2231 | 2228 |
if(!stringIsEmpty(freetext.trim())) {; |
2232 | 2229 |
if (! freetext.matches("\\d\\.?")){ |
2233 |
NonViralName<?> currentName = currentMyName == null ? null : currentMyName.getTaxonNameBase();
|
|
2230 |
INonViralName currentName = currentMyName == null ? null : currentMyName.getTaxonNameBase();
|
|
2234 | 2231 |
boolean handled = false; |
2235 | 2232 |
if (currentName != null && !wasSynonym){ |
2236 | 2233 |
handled = addFollowingTextToName (currentName, childNode.getTextContent() ); |
... | ... | |
2308 | 2305 |
nameToBeFilled = TaxonNameFactory.NewBotanicalInstance(null); |
2309 | 2306 |
} |
2310 | 2307 |
if (nomenclaturalCode.equals(NomenclaturalCode.ICZN)){ |
2311 |
nameToBeFilled = ZoologicalName.NewInstance(null);
|
|
2308 |
nameToBeFilled = TaxonNameFactory.NewZoologicalInstance(null);
|
|
2312 | 2309 |
} |
2313 | 2310 |
if (nomenclaturalCode.equals(NomenclaturalCode.ICNB)){ |
2314 |
nameToBeFilled = BacterialName.NewInstance(null);
|
|
2311 |
nameToBeFilled = TaxonNameFactory.NewBacterialInstance(null);
|
|
2315 | 2312 |
} |
2316 | 2313 |
nameToBeFilled.setTitleCache(s, true); |
2317 | 2314 |
nameToBeFilled.setRank(getRank(r), true); |
... | ... | |
3050 | 3047 |
private void createUnparsedSynonymNew(Rank rank, String newName, HashMap<String, String> atomisedMap, MyName myname, Reference refMods) { |
3051 | 3048 |
logger.info("createSynonym"); |
3052 | 3049 |
|
3053 |
NonViralName<?> nameToBeFilled = this.getNonViralNameAccNomenclature();
|
|
3050 |
INonViralName nameToBeFilled = this.getNonViralNameAccNomenclature();
|
|
3054 | 3051 |
//System.out.println("createsynonym"); |
3055 | 3052 |
if(rank.equals(Rank.UNKNOWN_RANK())){ |
3056 | 3053 |
//TODO |
... | ... | |
3209 | 3206 |
classification = classification2; |
3210 | 3207 |
} |
3211 | 3208 |
|
3212 |
/** |
|
3213 |
* @param tnb |
|
3214 |
* cast the current taxonnamebase into a botanical name or zoological or bacterial name |
|
3215 |
* if errors, cast into a classis nonviralname |
|
3216 |
* @param taxonnamebase2 |
|
3217 |
*/ |
|
3218 |
@SuppressWarnings("rawtypes") |
|
3219 |
public NonViralName<?> castTaxonNameBase(TaxonNameBase tnb, NonViralName<?> nvn) { |
|
3220 |
|
|
3221 |
//logger.info("castTaxonNameBase"); |
|
3222 |
NonViralName<?> taxonnamebase2 = nvn; |
|
3223 |
if (nomenclaturalCode.equals(NomenclaturalCode.ICNAFP)) { |
|
3224 |
try{ |
|
3225 |
taxonnamebase2=(BotanicalName) tnb; |
|
3226 |
}catch(Exception e){ |
|
3227 |
taxonnamebase2= (NonViralName<?>) tnb; |
|
3228 |
} |
|
3229 |
} |
|
3230 |
if (nomenclaturalCode.equals(NomenclaturalCode.ICZN)) { |
|
3231 |
try{ |
|
3232 |
taxonnamebase2=(ZoologicalName) tnb; |
|
3233 |
}catch(Exception e){ |
|
3234 |
taxonnamebase2= (NonViralName<?>) tnb; |
|
3235 |
} |
|
3236 |
} |
|
3237 |
if (nomenclaturalCode.equals(NomenclaturalCode.ICNB)) { |
|
3238 |
try{ |
|
3239 |
taxonnamebase2=(BacterialName) tnb; |
|
3240 |
}catch(Exception e){ |
|
3241 |
taxonnamebase2= (NonViralName<?>) tnb; |
|
3242 |
} |
|
3243 |
} |
|
3244 |
return taxonnamebase2; |
|
3245 |
} |
|
3246 | 3209 |
|
3247 |
/** |
|
3248 |
* @param tnb |
|
3249 |
* cast the current taxonnamebase into a botanical name or zoological or bacterial name |
|
3250 |
* if errors, cast into a classis nonviralname |
|
3251 |
* @param taxonnamebase2 |
|
3252 |
*/ |
|
3253 |
@SuppressWarnings("rawtypes") |
|
3254 |
public NonViralName<?> castTaxonNameBase(TaxonNameBase tnb) { |
|
3255 |
//logger.info("castTaxonNameBase2"); |
|
3256 |
NonViralName<?> taxonnamebase2 = null; |
|
3257 |
tnb=CdmBase.deproxy(tnb, TaxonNameBase.class); |
|
3258 |
if (nomenclaturalCode.equals(NomenclaturalCode.ICNAFP)) { |
|
3259 |
try{ |
|
3260 |
taxonnamebase2=(BotanicalName) tnb; |
|
3261 |
}catch(Exception e){ |
|
3262 |
taxonnamebase2= (NonViralName<?>) tnb; |
|
3263 |
} |
|
3264 |
} |
|
3265 |
if (nomenclaturalCode.equals(NomenclaturalCode.ICZN)) { |
|
3266 |
try{ |
|
3267 |
taxonnamebase2=(ZoologicalName) tnb; |
|
3268 |
}catch(Exception e){ |
|
3269 |
taxonnamebase2= (NonViralName<?>) tnb; |
|
3270 |
} |
|
3271 |
} |
|
3272 |
if (nomenclaturalCode.equals(NomenclaturalCode.ICNB)) { |
|
3273 |
try{ |
|
3274 |
taxonnamebase2=(BacterialName) tnb; |
|
3275 |
}catch(Exception e){ |
|
3276 |
taxonnamebase2= (NonViralName<?>) tnb; |
|
3277 |
} |
|
3278 |
} |
|
3279 |
return taxonnamebase2; |
|
3280 |
} |
|
3281 | 3210 |
|
3282 | 3211 |
public class MyName { |
3283 | 3212 |
/** |
... | ... | |
3295 | 3224 |
String status=""; |
3296 | 3225 |
String author=null; |
3297 | 3226 |
|
3298 |
NonViralName<?> taxonNameBase;
|
|
3227 |
TaxonNameBase<?,?> taxonNameBase;
|
|
3299 | 3228 |
|
3300 | 3229 |
Reference refMods ; |
3301 | 3230 |
|
3302 | 3231 |
Taxon family,subfamily,tribe,subtribe,genus,subgenus,species,subspecies, variety,form; |
3303 |
NonViralName<?> familyName, subfamilyName, tribeName,subtribeName,genusName,subgenusName,speciesName,subspeciesName;
|
|
3232 |
INonViralName familyName, subfamilyName, tribeName,subtribeName,genusName,subgenusName,speciesName,subspeciesName;
|
|
3304 | 3233 |
String familyStr, subfamilyStr, tribeStr,subtribeStr,genusStr,subgenusStr,speciesStr,subspeciesStr,formStr,varietyStr; |
3305 | 3234 |
Integer publicationYear; |
3306 | 3235 |
|
... | ... | |
3608 | 3537 |
this.syno=(Synonym)tmpTaxonBase; |
3609 | 3538 |
} |
3610 | 3539 |
|
3611 |
taxonNameBase = castTaxonNameBase(tnb, taxonNameBase);
|
|
3540 |
taxonNameBase = tnb;
|
|
3612 | 3541 |
|
3613 | 3542 |
} |
3614 | 3543 |
|
... | ... | |
3692 | 3621 |
author1=taxonNameBase.getAuthorshipCache(); |
3693 | 3622 |
} |
3694 | 3623 |
try { |
3695 |
if(castTaxonNameBase(bestMatchingTaxon.getName()).getAuthorshipCache()!=null) {
|
|
3696 |
author2=castTaxonNameBase(bestMatchingTaxon.getName()).getAuthorshipCache();
|
|
3624 |
if(bestMatchingTaxon.getName().getAuthorshipCache()!=null) {
|
|
3625 |
author2=bestMatchingTaxon.getName().getAuthorshipCache();
|
|
3697 | 3626 |
} |
3698 | 3627 |
} catch (Exception e) { |
3699 | 3628 |
// TODO Auto-generated catch block |
... | ... | |
3898 | 3827 |
/** |
3899 | 3828 |
* @param nameToBeFilledTest |
3900 | 3829 |
*/ |
3901 |
@SuppressWarnings("rawtypes") |
|
3902 | 3830 |
public void setParsedName(ITaxonNameBase nameToBeFilledTest) { |
3903 |
this.taxonNameBase = (NonViralName<?>) nameToBeFilledTest;
|
|
3831 |
this.taxonNameBase = TaxonNameBase.castAndDeproxy(nameToBeFilledTest);
|
|
3904 | 3832 |
|
3905 | 3833 |
} |
3906 | 3834 |
//variety dwcranks:varietyEpithet |
... | ... | |
3919 | 3847 |
/** |
3920 | 3848 |
* @return |
3921 | 3849 |
*/ |
3922 |
public NonViralName<?> getTaxonNameBase() {
|
|
3850 |
public TaxonNameBase<?,?> getTaxonNameBase() {
|
|
3923 | 3851 |
return taxonNameBase; |
3924 | 3852 |
} |
3925 | 3853 |
|
... | ... | |
4046 | 3974 |
} |
4047 | 3975 |
if ((tmp == null || !foundIdentic) || (tmp != null && !statusMatch) || (tmp != null && !appendedMatch && !statusMatch)){ |
4048 | 3976 |
|
4049 |
NonViralName<?> tnb = getNonViralNameAccNomenclature();
|
|
3977 |
INonViralName tnb = getNonViralNameAccNomenclature();
|
|
4050 | 3978 |
tnb.setRank(rank); |
4051 | 3979 |
|
4052 | 3980 |
if(statusType != null) { |
... | ... | |
4141 | 4069 |
* @param tnb |
4142 | 4070 |
* @return |
4143 | 4071 |
*/ |
4144 |
private Taxon buildSubfamily(NonViralName<?> tnb) {
|
|
4072 |
private Taxon buildSubfamily(INonViralName tnb) {
|
|
4145 | 4073 |
Taxon tmp; |
4146 | 4074 |
// tnb.generateTitle(); |
4147 | 4075 |
tmp = findMatchingTaxon(tnb,refMods); |
... | ... | |
4167 | 4095 |
* @param tnb |
4168 | 4096 |
* @return |
4169 | 4097 |
*/ |
4170 |
private Taxon buildFamily(NonViralName<?> tnb) {
|
|
4098 |
private Taxon buildFamily(INonViralName tnb) {
|
|
4171 | 4099 |
Taxon tmp; |
4172 | 4100 |
// tnb.generateTitle(); |
4173 | 4101 |
tmp = findMatchingTaxon(tnb,refMods); |
... | ... | |
4188 | 4116 |
* @param tnb |
4189 | 4117 |
* @return |
4190 | 4118 |
*/ |
4191 |
private Taxon buildForm(String fullname, String partialname, NonViralName<?> tnb) {
|
|
4119 |
private Taxon buildForm(String fullname, String partialname, INonViralName tnb) {
|
|
4192 | 4120 |
if (genusName !=null) { |
4193 | 4121 |
tnb.setGenusOrUninomial(genusName.getGenusOrUninomial()); |
4194 | 4122 |
} |
... | ... | |
4237 | 4165 |
* @param tnb |
4238 | 4166 |
* @return |
4239 | 4167 |
*/ |
4240 |
private Taxon buildVariety(String fullname, String partialname, NonViralName<?> tnb) {
|
|
4168 |
private Taxon buildVariety(String fullname, String partialname, INonViralName tnb) {
|
|
4241 | 4169 |
Taxon tmp; |
4242 | 4170 |
if (genusName !=null) { |
4243 | 4171 |
tnb.setGenusOrUninomial(genusName.getGenusOrUninomial()); |
... | ... | |
4287 | 4215 |
* @param tnb |
4288 | 4216 |
* @return |
4289 | 4217 |
*/ |
4290 |
private Taxon buildSubspecies(String partialname, NonViralName<?> tnb) {
|
|
4218 |
private Taxon buildSubspecies(String partialname, INonViralName tnb) {
|
|
4291 | 4219 |
if (genusName !=null) { |
4292 | 4220 |
tnb.setGenusOrUninomial(genusName.getGenusOrUninomial()); |
4293 | 4221 |
} |
... | ... | |
4327 | 4255 |
* @param tnb |
4328 | 4256 |
* @return |
4329 | 4257 |
*/ |
4330 |
private Taxon buildSpecies(String partialname, NonViralName<?> tnb) {
|
|
4258 |
private Taxon buildSpecies(String partialname, INonViralName tnb) {
|
|
4331 | 4259 |
if (genusName !=null) { |
4332 | 4260 |
tnb.setGenusOrUninomial(genusName.getGenusOrUninomial()); |
4333 | 4261 |
} |
... | ... | |
4366 | 4294 |
* @param tnb |
4367 | 4295 |
* @return |
4368 | 4296 |
*/ |
4369 |
private Taxon buildSubgenus(String partialname, NonViralName<?> tnb) {
|
|
4297 |
private Taxon buildSubgenus(String partialname, INonViralName tnb) {
|
|
4370 | 4298 |
tnb.setInfraGenericEpithet(partialname); |
4371 | 4299 |
if (genusName !=null) { |
4372 | 4300 |
tnb.setGenusOrUninomial(genusName.getGenusOrUninomial()); |
... | ... | |
4395 | 4323 |
* @param tnb |
4396 | 4324 |
* @return |
4397 | 4325 |
*/ |
4398 |
private Taxon buildGenus(String partialname, NonViralName<?> tnb) {
|
|
4326 |
private Taxon buildGenus(String partialname, INonViralName tnb) {
|
|
4399 | 4327 |
Taxon tmp; |
4400 | 4328 |
tnb.setGenusOrUninomial(partialname); |
4401 | 4329 |
|
... | ... | |
4444 | 4372 |
* @param tnb |
4445 | 4373 |
* @return |
4446 | 4374 |
*/ |
4447 |
private Taxon buildSubtribe(NonViralName<?> tnb) {
|
|
4375 |
private Taxon buildSubtribe(INonViralName tnb) {
|
|
4448 | 4376 |
Taxon tmp = findMatchingTaxon(tnb,refMods); |
4449 | 4377 |
if(tmp==null){ |
4450 | 4378 |
tmp = Taxon.NewInstance(tnb, sourceUrlRef); |
... | ... | |
4468 | 4396 |
* @param tnb |
4469 | 4397 |
* @return |
4470 | 4398 |
*/ |
4471 |
private Taxon buildTribe(NonViralName<?> tnb) {
|
|
4399 |
private Taxon buildTribe(INonViralName tnb) {
|
|
4472 | 4400 |
Taxon tmp = findMatchingTaxon(tnb,refMods); |
4473 | 4401 |
if(tmp==null){ |
4474 | 4402 |
tmp = Taxon.NewInstance(tnb, sourceUrlRef); |
... | ... | |
4665 | 4593 |
@SuppressWarnings("rawtypes") |
4666 | 4594 |
public void setFamily(Taxon family) { |
4667 | 4595 |
this.family = family; |
4668 |
TaxonNameBase taxonNameBase = CdmBase.deproxy(family.getName(), TaxonNameBase.class); |
|
4669 |
familyName = castTaxonNameBase(taxonNameBase,familyName); |
|
4596 |
familyName = CdmBase.deproxy(family.getName()); |
|
4670 | 4597 |
} |
4671 | 4598 |
/** |
4672 | 4599 |
* @return the subfamily |
... | ... | |
4680 | 4607 |
@SuppressWarnings("rawtypes") |
4681 | 4608 |
public void setSubfamily(Taxon subfamily) { |
4682 | 4609 |
this.subfamily = subfamily; |
4683 |
TaxonNameBase taxonNameBase = CdmBase.deproxy(subfamily.getName(), TaxonNameBase.class); |
|
4684 |
subfamilyName = castTaxonNameBase(taxonNameBase,subfamilyName); |
|
4610 |
subfamilyName = CdmBase.deproxy(subfamily.getName()); |
|
4685 | 4611 |
} |
4686 | 4612 |
/** |
4687 | 4613 |
* @return the tribe |
... | ... | |
4695 | 4621 |
@SuppressWarnings("rawtypes") |
4696 | 4622 |
public void setTribe(Taxon tribe) { |
4697 | 4623 |
this.tribe = tribe; |
4698 |
TaxonNameBase taxonNameBase = CdmBase.deproxy(tribe.getName(), TaxonNameBase.class); |
|
4699 |
tribeName = castTaxonNameBase(taxonNameBase,tribeName); |
|
4624 |
tribeName = CdmBase.deproxy(tribe.getName()); |
|
4700 | 4625 |
} |
4701 | 4626 |
/** |
4702 | 4627 |
* @return the subtribe |
... | ... | |
4710 | 4635 |
@SuppressWarnings("rawtypes") |
4711 | 4636 |
public void setSubtribe(Taxon subtribe) { |
4712 | 4637 |
this.subtribe = subtribe; |
4713 |
TaxonNameBase taxonNameBase = CdmBase.deproxy(subtribe.getName(), TaxonNameBase.class); |
|
4714 |
subtribeName =castTaxonNameBase(taxonNameBase,subtribeName); |
|
4638 |
subtribeName =CdmBase.deproxy(subtribe.getName()); |
|
4715 | 4639 |
} |
4716 | 4640 |
/** |
4717 | 4641 |
* @return the genus |
... | ... | |
4726 | 4650 |
public void setGenus(Taxon genus) { |
4727 | 4651 |
if (genus != null){ |
4728 | 4652 |
this.genus = genus; |
4729 |
TaxonNameBase taxonNameBase = CdmBase.deproxy(genus.getName(), TaxonNameBase.class); |
|
4730 |
genusName = castTaxonNameBase(taxonNameBase,genusName); |
|
4653 |
genusName = CdmBase.deproxy(genus.getName()); |
|
4731 | 4654 |
} |
4732 | 4655 |
} |
4733 | 4656 |
/** |
... | ... | |
4742 | 4665 |
@SuppressWarnings("rawtypes") |
4743 | 4666 |
public void setSubgenus(Taxon subgenus) { |
4744 | 4667 |
this.subgenus = subgenus; |
4745 |
TaxonNameBase taxonNameBase = CdmBase.deproxy(subgenus.getName(), TaxonNameBase.class); |
|
4746 |
subgenusName = castTaxonNameBase(taxonNameBase,subgenusName); |
|
4668 |
subgenusName = CdmBase.deproxy(subgenus.getName()); |
|
4747 | 4669 |
} |
4748 | 4670 |
/** |
4749 | 4671 |
* @return the species |
... | ... | |
4757 | 4679 |
public void setSpecies(Taxon species) { |
4758 | 4680 |
if (species != null){ |
4759 | 4681 |
this.species = species; |
4760 |
@SuppressWarnings("rawtypes") |
|
4761 |
TaxonNameBase taxonNameBase = CdmBase.deproxy(species.getName(), TaxonNameBase.class); |
|
4762 |
speciesName = castTaxonNameBase(taxonNameBase,speciesName); |
|
4682 |
speciesName = CdmBase.deproxy(species.getName()); |
|
4763 | 4683 |
} |
4764 | 4684 |
} |
4765 | 4685 |
/** |
... | ... | |
4774 | 4694 |
@SuppressWarnings("rawtypes") |
4775 | 4695 |
public void setSubspecies(Taxon subspecies) { |
4776 | 4696 |
this.subspecies = subspecies; |
4777 |
TaxonNameBase taxonNameBase = CdmBase.deproxy(subspecies.getName(), TaxonNameBase.class); |
|
4778 |
subspeciesName = castTaxonNameBase(taxonNameBase,subspeciesName); |
|
4697 |
subspeciesName = CdmBase.deproxy(subspecies.getName()); |
|
4779 | 4698 |
|
4780 | 4699 |
} |
4781 | 4700 |
|
... | ... | |
4838 | 4757 |
e.printStackTrace(); |
4839 | 4758 |
} |
4840 | 4759 |
try { |
4841 |
if(castTaxonNameBase(bestMatchingTaxon.getName()).getAuthorshipCache()!=null) {
|
|
4842 |
author2=castTaxonNameBase(bestMatchingTaxon.getName()).getAuthorshipCache();
|
|
4760 |
if(bestMatchingTaxon.getName().getAuthorshipCache()!=null) {
|
|
4761 |
author2=bestMatchingTaxon.getName().getAuthorshipCache();
|
|
4843 | 4762 |
} |
4844 | 4763 |
} catch (Exception e) { |
4845 | 4764 |
// TODO Auto-generated catch block |
... | ... | |
5019 | 4938 |
* @param taxonNameBase |
5020 | 4939 |
*/ |
5021 | 4940 |
@SuppressWarnings("rawtypes") |
5022 |
public void lookForParentNode(NonViralName<?> taxonNameBase, Taxon tax, Reference ref, MyName myName) {
|
|
4941 |
public void lookForParentNode(INonViralName taxonNameBase, Taxon tax, Reference ref, MyName myName) {
|
|
5023 | 4942 |
logger.info("lookForParentNode "+taxonNameBase.getTitleCache()+" for "+myName.toString()); |
5024 | 4943 |
//System.out.println("LOOK FOR PARENT NODE "+taxonnamebase.toString()+"; "+tax.toString()+"; "+taxonnamebase.getRank()); |
5025 | 4944 |
INonViralNameParser parser = NonViralNameParserImpl.NewInstance(); |
... | ... | |
5079 | 4998 |
} |
5080 | 4999 |
} |
5081 | 5000 |
if(parent == null) { |
5082 |
NonViralName<?> parentNameName = (NonViralName<?>) parser.parseFullName(parentStr, nomenclaturalCode, r);
|
|
5001 |
INonViralName parentNameName = parser.parseFullName(parentStr, nomenclaturalCode, r);
|
|
5083 | 5002 |
Taxon tmp = findMatchingTaxon(parentNameName,ref); |
5084 | 5003 |
if(tmp ==null) |
5085 | 5004 |
{ |
... | ... | |
5109 | 5028 |
r = Rank.FAMILY(); |
5110 | 5029 |
} |
5111 | 5030 |
if(parentStr!=null){ |
5112 |
NonViralName<?> parentNameName = (NonViralName<?>) parser.parseFullName(parentStr, nomenclaturalCode, r);
|
|
5031 |
INonViralName parentNameName = parser.parseFullName(parentStr, nomenclaturalCode, r);
|
|
5113 | 5032 |
Taxon parent = Taxon.NewInstance(parentNameName, ref); //sec set null |
5114 | 5033 |
// importer.getTaxonService().save(parent); |
5115 | 5034 |
// parent = CdmBase.deproxy(parent, Taxon.class); |
... | ... | |
5161 | 5080 |
r = Rank.FAMILY(); |
5162 | 5081 |
} |
5163 | 5082 |
if(parentStr!=null){ |
5164 |
NonViralName<?> parentNameName = (NonViralName<?>) parser.parseFullName(parentStr, nomenclaturalCode, r);
|
|
5083 |
INonViralName parentNameName = parser.parseFullName(parentStr, nomenclaturalCode, r);
|
|
5165 | 5084 |
Taxon parent = Taxon.NewInstance(parentNameName, ref); //sec set null |
5166 | 5085 |
// importer.getTaxonService().save(parent); |
5167 | 5086 |
// parent = CdmBase.deproxy(parent, Taxon.class); |
... | ... | |
5218 | 5137 |
r = Rank.FAMILY(); |
5219 | 5138 |
} |
5220 | 5139 |
if(parentStr!=null){ |
5221 |
NonViralName<?> parentNameName = (NonViralName<?>) parser.parseFullName(parentStr, nomenclaturalCode, r);
|
|
5140 |
INonViralName parentNameName = parser.parseFullName(parentStr, nomenclaturalCode, r);
|
|
5222 | 5141 |
Taxon parent = Taxon.NewInstance(parentNameName, ref); //sec set null |
5223 | 5142 |
// importer.getTaxonService().save(parent); |
5224 | 5143 |
// parent = CdmBase.deproxy(parent, Taxon.class); |
... | ... | |
5281 | 5200 |
r = Rank.FAMILY(); |
5282 | 5201 |
} |
5283 | 5202 |
if(parentStr!=null){ |
5284 |
NonViralName<?> parentNameName = (NonViralName<?>) parser.parseFullName(parentStr, nomenclaturalCode, r);
|
|
5203 |
INonViralName parentNameName = parser.parseFullName(parentStr, nomenclaturalCode, r);
|
|
5285 | 5204 |
Taxon parent = Taxon.NewInstance(parentNameName, ref); //sec set null |
5286 | 5205 |
// importer.getTaxonService().save(parent); |
5287 | 5206 |
// parent = CdmBase.deproxy(parent, Taxon.class); |
... | ... | |
5503 | 5422 |
* @return |
5504 | 5423 |
*/ |
5505 | 5424 |
private Taxon handleParentName(Reference ref, MyName myName, INonViralNameParser<?> parser, String parentStr, Rank r) { |
5506 |
NonViralName<?> parentNameName = (NonViralName<?>) parser.parseFullName(parentStr, nomenclaturalCode, r);
|
|
5425 |
INonViralName parentNameName = parser.parseFullName(parentStr, nomenclaturalCode, r);
|
|
5507 | 5426 |
Taxon parent = Taxon.NewInstance(parentNameName, ref); //sec set null |
5508 | 5427 |
// importer.getTaxonService().save(parent); |
5509 | 5428 |
// parent = CdmBase.deproxy(parent, Taxon.class); |
Also available in: Unified diff
ref #6362, ref #6365 remove occurrence of NonViralName, BotanicalName, ZoologicalName and others