public static String reflectiontostring (Object o) {
if (o = = null) return stringutils.empty;
StringBuilder tostr = new StringBuilder ();
if (o instanceof Collection) {
Iterator it = ((Collection) O). Iterator ();
while (It.hasnext ()) {
Tostr.append (Reflectiontostring (It.next ()));
Tostr.append ("\ n");
}
}else if (o instanceof Map) {
Iterator<map.entry> mit = ((MAP) O). EntrySet (). Iterator ();
while (Mit.hasnext ()) {
Map.entry Entry = Mit.next ();
String kv = Entry.getkey () + ":" + reflectiontostring (Entry.getvalue ());
Tostr.append (KV);
Tostr.append ("");
}
} else if (o instanceof object[]) {
for (Object temp: (object[]) o) {
Tostr.append (reflectiontostring (temp));
}
}else if (o instanceof String) {
Tostr.append (o);
} else {
Tostr.append (Tostringbuilder.reflectiontostring (o, Tostringstyle.short_prefix_style));
}
return tostr.tostring ();
}
Java output object is a string