Dumps Java object state into human readable format (similar, but not exact, to JavaFX literal). For example:
Dumper dmpr = new Dumper(); System.out.println(dmpr.dump(new Date()));
prints:
java.util.Date{
cdate : null
fastTime : 1218288272098
}Another example:
Dumper dmpr = new Dumper();
dmpr.setRadix(16); //You could use radix up to Character.MAX_RADIX, 31 for example :-)
dmpr.setIDENT("\t");
dmpr.setMaxDepth(5); //In this particular example this parameter matter
System.out.println(dmpr.dump(new ByteArrayInputStream("123456789".getBytes())));prints:
java.io.ByteArrayInputStream{
buf : [ // byte[9]
31h, 32h, 33h, 34h, 35h, 36h, 37h, 38h,
39h
]
count : 9h
mark : 0h
pos : 0h
}Current status: v 1.5 is stable and is used in real project for 6 month.
Dumper dumps java objects using .toString() and has special format for dmping Map, List, Set, Date classes.
You could also take a look at BigExample
TODO:
- Make more settings (array width, in which form cycle ref's should be print, etc)
- Write JavaDoc, especially about settings
- Several ways to dump cyclic ref's
- Add set of field names that should be excluded from dump