Revision 54c019c9
Added by Andreas Müller about 16 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/name/NonViralNameDefaultCacheStrategy.java | ||
---|---|---|
305 | 305 |
result += " " + (CdmUtils.Nz(nonViralName.getInfraSpecificEpithet())).trim(); |
306 | 306 |
result = result.trim().replace("null", "-"); |
307 | 307 |
//result += " (rankless)"; |
308 |
result = addAppendedPhrase(result, nonViralName); |
|
308 | 309 |
return result; |
309 | 310 |
} |
310 | 311 |
|
... | ... | |
312 | 313 |
protected String getGenusOrUninomialNameCache(NonViralName nonViralName){ |
313 | 314 |
String result; |
314 | 315 |
result = CdmUtils.Nz(nonViralName.getGenusOrUninomial()); |
316 |
result = addAppendedPhrase(result, nonViralName); |
|
315 | 317 |
return result; |
316 | 318 |
} |
317 | 319 |
|
... | ... | |
319 | 321 |
String result; |
320 | 322 |
result = CdmUtils.Nz(nonViralName.getGenusOrUninomial()); |
321 | 323 |
result += " (" + (CdmUtils.Nz(nonViralName.getInfraGenericEpithet()) + ")").trim().replace("null", ""); |
324 |
result = addAppendedPhrase(result, nonViralName); |
|
322 | 325 |
return result; |
323 | 326 |
} |
324 | 327 |
|
... | ... | |
327 | 330 |
String result; |
328 | 331 |
result = CdmUtils.Nz(nonViralName.getGenusOrUninomial()); |
329 | 332 |
result += " " + CdmUtils.Nz(nonViralName.getSpecificEpithet()).trim().replace("null", ""); |
333 |
result = addAppendedPhrase(result, nonViralName); |
|
330 | 334 |
return result; |
331 | 335 |
} |
332 | 336 |
|
... | ... | |
339 | 343 |
result += " " + (nonViralName.getRank().getAbbreviation()).trim().replace("null", ""); |
340 | 344 |
} |
341 | 345 |
result += " " + (CdmUtils.Nz(nonViralName.getInfraSpecificEpithet())).trim().replace("null", ""); |
346 |
result = addAppendedPhrase(result, nonViralName); |
|
342 | 347 |
return result; |
343 | 348 |
} |
344 | 349 |
|
... | ... | |
355 | 360 |
return false; |
356 | 361 |
} |
357 | 362 |
} |
363 |
|
|
364 |
protected String addAppendedPhrase(String resultString, NonViralName nonViralName){ |
|
365 |
String appendedPhrase = nonViralName ==null ? null : nonViralName.getAppendedPhrase(); |
|
366 |
if (resultString == null){ |
|
367 |
return appendedPhrase; |
|
368 |
}else if(appendedPhrase == null || "".equals(appendedPhrase.trim())) { |
|
369 |
return resultString; |
|
370 |
}else if ("".equals(resultString)){ |
|
371 |
return resultString + appendedPhrase; |
|
372 |
}else { |
|
373 |
return resultString + " " + appendedPhrase; |
|
374 |
} |
|
375 |
} |
|
358 | 376 |
|
359 | 377 |
} |
Also available in: Unified diff
appendedPhrase