Is it possible to get the whole object from debugger as Json?
There is an option View text
but can I somehow View JSON
?
Is it possible to get the whole object from debugger as Json?
There is an option View text
but can I somehow View JSON
?
编辑:正如 comments 中所指出的,这并不完美,因为对于某些变量,您将得到"stackoverflow"响应
正如@Mr Han's answer所建议的,以下是你可以做到这一点的方法:
File | Settings | Build, Execution, Deployment | Debugger | Data Views | Java Type Renderers
+
添加新渲染器JSON renderer
java.lang.Object
for Apply renderer to objects of type
Use following expression:
并提供如下表达式:if (null == this || this instanceof String)
return this;
new com.google.gson.GsonBuilder().setPrettyPrinting().create().toJson(this);