Is it possible to create a JSON configuration form a String in Apache commons configuration so that I can get some values from it?
For example, if I'd have a String containing this configuration, I'd like to be able to convert it into an org.apache.commons.configuration2.json.JSONConfiguration so that I can get values from it with the getX(nodeName) method (ex.: config.getInt("sectionA.valueB") would return 332):
{sectionA:{valueA:true, valueB:332}, sectionB:{valueA:124, valueB:"abc"}}
Would I have to wrap the string in something such as a Reader so that I can use the configuration's load(Reader) method? If yes, what would be the shortest and fastest way to do that?
I'd much rather use JSON than XML, but short of writing my own JSON shim for the library, I don't see any 'built in' solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With