} else if (obj instanceof ShortBlob) {
result = new StringPropertyInfo(new String(((ShortBlob) obj).getBytes()));
} else if (obj instanceof Blob) {
Blob b = (Blob) obj;
String fileName = index == null ? propertyName : propertyName + "[" + index + "]";
FileDownloadPath downloadPath = AutoBeanUtil.newFileDownloadPath(
FileDownloadPath.Type.DATASTORE_BLOB, keyString, propertyName, index, fileName, b.getBytes().length);
String pathStr = AutoBeanUtil.encode(FileDownloadPath.class, downloadPath);
result = new BlobPropertyInfo(b.getBytes().length, pathStr);
} else if (obj instanceof BlobStringWrapper) { // user has edited a blob, in string form, it's not in memcache, nor datastore
result = new BlobPropertyInfo(((BlobStringWrapper) obj).getRawString().getBytes());
} else if (obj instanceof BlobFileRefWrapper) { // user has uploaded the blob, but still stay in memcache
FileDownloadPath path = ((BlobFileRefWrapper) obj).getRef();
String pathStr = AutoBeanUtil.encode(FileDownloadPath.class, path);
result = new BlobPropertyInfo(path.getSize(), pathStr);
} else if (obj instanceof BlobKey) {
String blobKeyString = ((BlobKey) obj).getKeyString();
result = new BlobKeyPropertyInfo(blobKeyString);
} else if (obj instanceof Key) {
result = convert((Key)obj);
} else if (obj instanceof Link) {
result = new StringPropertyInfo(((Link) obj).getValue());
} else if (obj instanceof IMHandle) {
String protocol = ((IMHandle) obj).getProtocol();
String address = ((IMHandle) obj).getAddress();
result = new IMHandlePropertyInfo(protocol, address);
} else if (obj instanceof PostalAddress) {
result = new StringPropertyInfo(((PostalAddress) obj).getAddress());
} else if (obj instanceof Rating) {
result = new LongPropertyInfo(((Rating) obj).getRating());
} else if (obj instanceof PhoneNumber) {
result = new StringPropertyInfo(((PhoneNumber) obj).getNumber());
} else if (obj instanceof Text) {
Text t = (Text)obj;
String fileName = index == null ? propertyName : propertyName + "[" + index + "]";
FileDownloadPath downloadPath = AutoBeanUtil.newFileDownloadPath(
FileDownloadPath.Type.DATASTORE_TEXT, keyString, propertyName, index,
fileName, t.getValue().length());
String pathStr = AutoBeanUtil.encode(FileDownloadPath.class, downloadPath);
String fullStr = ((Text) obj).getValue();
result = new TextPropertyInfo(fullStr, pathStr);
} else if (obj instanceof TextStringWrapper) {
result = new TextPropertyInfo(((TextStringWrapper) obj).getRawString());
} else if (obj instanceof TextFileRefWrapper) {
FileDownloadPath path = ((TextFileRefWrapper) obj).getRef();
String pathStr = AutoBeanUtil.encode(FileDownloadPath.class, path);
result = new TextPropertyInfo("No preview available", path.getSize(), pathStr);
} else if (obj instanceof List) {
@SuppressWarnings("rawtypes")
List list = (List) obj;
ListPropertyInfo propertyInfo = new ListPropertyInfo();