constretto-core icon indicating copy to clipboard operation
constretto-core copied to clipboard

Rewrite the JSON Configuration store support

Open zapodot opened this issue 10 years ago • 0 comments

The current JSON configuration store support is really quite limited and does not support tagging or hierarchical JSON documents really well..

It should really be rewritten to support JSON documents such as:

{
   "key": "default value",
   "@testing.key": "value used for \"testing\"",
   "sub": {
      "anotherKey": "anotherValue"
     }
}

Ideally it should resolve like this:

final ConstrettoConfiguration conf = ...
if(conf.getCurrentTags().contains("testing")) {
    System.out.println(conf.evaluteToString("key")); // prints "value used for "testing" 
} else {
    System.out.println(conf.evaluteToString("key")); // prints "default value" 
} 
System.out.println(conf.evaluteToString("sub.anotherKey")); // prints "anotherValue" 

zapodot avatar Feb 12 '15 09:02 zapodot