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?