Dumping a java object's properties

后端 未结 10 1752
-上瘾入骨i
-上瘾入骨i 2020-11-28 02:03

Is there a library that will recursively dump/print an objects properties? I\'m looking for something similar to the console.dir() function in Firebug.

I\'m aware o

10条回答
  •  青春惊慌失措
    2020-11-28 02:41

    You should use RecursiveToStringStyle:

    System.out.println(ReflectionToStringBuilder.toString(new Outer(), new RecursiveToStringStyle()));
    

提交回复
热议问题