Pretty print XML by DeaneOC · Pull Request #694 · stleary/JSON-java

@DeaneOC Nice work. Can you please make the following changes?

  • New methods should have JavaDocs, especially for new parameters.
  • Make sure new methods actually need to be public, or else use more restrictive access.
  • Unit test very large strings should be stored in src/test/resources. You can search for 'issue537' for an example of how to do this.

Thanks @stleary

In terms of point one and two, I have JavaDoc comments on the three new methods that are public:

toString(object, indentFactor)
toString(object, tagLine, indentFactor)
toString(object, tagline, config, indentFactor)

You can currently call toString three different ways so I thought three new public methods that can also take an indent factor were appropriate.

The two methods below are private as users should not be able to call them directly, so I have not added JavaDocs, if you would like me to do so let me know:

toString(object, tagline, config, indentFactor, indent)
indent(indent)

I believe the current restrictions on method access are correct, three public and two private as mentioned above but if you believe otherwise let me know.

Point 3: I have altered test three to use the resource, I was aware it was very long so very happy to make that change.

Thanks for getting back to me so quickly and let me know what you think about the above comments so I can make and required changes.