case SHORT_BLOB:
return new ShortBlob(((ShortBlobPropertyInfo) info).getPayload().getBytes());
case STRING:
return ((StringPropertyInfo) info).getPayload();
case TEXT:
TextPropertyInfo textInfo = (TextPropertyInfo) info;
if (textInfo.getRawText() == null) {
FileDownloadPath path = AutoBeanUtil.decode(FileDownloadPath.class, textInfo.getDownloadPath());
switch (path.getType()) {
case MEMCACHE:
byte [] data = (byte[]) memcache.get(path.getKeyStr());
// throw exception when rawData == null? cache get expired is possible
return new Text(new String(data));
case DATASTORE_TEXT:
// simply return existing one
Object val = e.getProperty(path.getFieldName());
if (val instanceof Text) {
return val;
} else if (val instanceof List) {
return ((List)val).get(path.getIndex());
} else {
// should not happen
throw new IllegalArgumentException("Can't locate text via path " + path.getFieldName() + " " + path.getIndex());
}
default:
// should not happen
throw new IllegalArgumentException("Can't locate text via path " + path.getFieldName() + " " + path.getIndex());
}
} else {
// edit text value directly
return new Text(textInfo.getRawText());
}
case TIMESTAMP:
return ((DatePropertyInfo) info).getPayload();
case USER:
UserPropertyInfo upi = (UserPropertyInfo) info;