toString() to JSON with Eclipse

right click –> Source –> generate toString() –> Generated code fieldset –> Edit button –> New.. button –> give a name (ex. JSON) –> copy and paste this pattern:

{"${}":"${member.value}", "${otherMembers}"}

That’s it.

Hope this help!


One thought on “toString() to JSON with Eclipse

  1. Tomás Gomes says:

    Problem is with numbers and dates that shoud not include “”

Add Your Comment: