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.name()}":"${member.value}", "${otherMembers}"}

That’s it.

Hope this help!

1 Comments

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: