public String getResourceUOM(Resource resource) {
if(resource == null) {
return unknownUOMKey;
}
if(resource instanceof GoodResource) {
UnitOfMeasure uom = ((GoodResource)resource).getUnitOfMeasure();
return uom == null ? unknownUOMKey : uom.name();
} else if(resource instanceof ServiceResource) {
return sessionUOMKey;
} else if(resource instanceof MoneyResource) {
ZECurrency currency = ((MoneyResource)resource).getCurrency();
return currency == null ? unknownUOMKey : currency.name();