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!

toString() to JSON with Eclipse

  1. Tomás Gomes ha detto:

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

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *