*
* @author p.ciardelli
* @author n.hoffmann
- * @created 02.04.2009
*/
public class DescriptionHelper {
}
}
String result = cache == null ? "" : cache;
- if (StringUtils.isNotBlank(mainElementLabel)){
+ if (isNotBlank(mainElementLabel)){
result = CdmUtils.concat(" ", result, "(" + mainElementLabel + ")");
}
return result;
if (taxonName != null){
taxonStr = taxonName.getTitleCache();
}
- if (StringUtils.isBlank(taxonStr) && taxon != null){
+ if (isBlank(taxonStr) && taxon != null){
taxonStr = taxon.getTitleCache();
}
- if (StringUtils.isBlank(taxonStr)){
+ if (isBlank(taxonStr)){
taxonStr = "no or unlabled taxon";
}
String unitStr;
if (unit != null){
unitStr = unit.getTitleCache();
- if (StringUtils.isBlank(unitStr)){
+ if (isBlank(unitStr)){
unitStr = "Unlabled unit";
}
}else{
if (classification != null){
String classificationStr = classification.getName() == null ? "" : classification.getName().getText();
result = CdmUtils.concat("" , result, classificationStr);
- if (StringUtils.isBlank(result)){
+ if (isBlank(result)){
result = classification.toString();
}
}
if (typeRepr != null){
typeLabel = typeRepr.getAbbreviatedLabel();
}
- if (StringUtils.isBlank(typeLabel) && typeRepr != null){
+ if (isBlank(typeLabel) && typeRepr != null){
typeLabel = typeRepr.getLabel();
}
- if (StringUtils.isBlank(typeLabel) ){
+ if (isBlank(typeLabel) ){
typeLabel = status.getSymbol();
}
- if (StringUtils.isBlank(typeLabel)){
+ if (isBlank(typeLabel)){
typeLabel = status.getTitleCache();
}
}
- if (StringUtils.isBlank(typeLabel)){
+ if (isBlank(typeLabel)){
typeLabel = "->";
}
String fromString = "";
if (typeRepr != null){
typeLabel = typeRepr.getAbbreviatedLabel();
}
- if (StringUtils.isBlank(typeLabel) && typeRepr != null){
+ if (isBlank(typeLabel) && typeRepr != null){
typeLabel = typeRepr.getLabel();
}
- if (StringUtils.isBlank(typeLabel) ){
+ if (isBlank(typeLabel) ){
typeLabel = type.getSymbol();
}
- if (StringUtils.isBlank(typeLabel)){
+ if (isBlank(typeLabel)){
typeLabel = type.getTitleCache();
}
}
- if (StringUtils.isBlank(typeLabel)){
+ if (isBlank(typeLabel)){
typeLabel = "->";
}
String result = CdmUtils.concat(" ", new String[]{from == null ? null : from.getTitleCache(),
for (TaxonName tnb : hg.getTypifiedNames()){
result = CdmUtils.concat(", ", result, tnb.getTitleCache());
}
- if (StringUtils.isBlank(result)){
+ if (isBlank(result)){
result = "No typified names";
}
return result;
text += " [ " + source.getNameUsedInSource().getTitleCache() + " ]";
}
}
- if(CdmUtils.isEmpty(text)){
+ if(isBlank(text)){
text = "No sources provided";
}
}else{
LanguageString languageString = element.getPreferredLanguageString(languages);
text = languageString != null ? languageString.getText() : null;
}
- return CdmUtils.isEmpty(text) ? "No text provided" : text;
+ return isBlank(text) ? "No text provided" : text;
}
/**
return element.toString();
}
}
+
+ private static boolean isNotBlank(String str){
+ return StringUtils.isNotBlank(str);
+ }
+
+ private static boolean isBlank(String str){
+ return StringUtils.isBlank(str);
+ }
}