简体   繁体   中英

Java JSON editor / visualizer

I wrote an application that takes a JSON file as configuration. Up to this point, I wrote the JSON config by hand. However, now I want to allow other users who are not familiar with JSON format to make their own configurations. There's only 3 types of objects that the configuration needs to store, but the user should be allowed to add multiple copies of these objects. I want to write a configuration application where the user can press a button such as "Add Type A" and an object of type A is populated with default values and visualized so that the user can select properties and edit them. I know how to write an application that does this, but I feel like I'm re-inventing the wheel. Does anyone know of an open-source Java library that I can use inside my config application to handle visualization and editing a JSON file? If I'm approaching this from completely the wrong direction, please let me know.

I'm tempted to say "don't fear to reinvent the wheel". But the fact is that there a bunch solutions available :

How do I convert an object to JSON representation (and vice-versa)
Java representation of JSON Object
Javascript to Java using JSON

among them, GSON looks fine.

For my personal experience, Yaml turned out to be an appropriate solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM