How to create hierarchical JSON from java.util.Properties object

Viewed 2846

I'm looking for good way or complete API to create a hierarchical JSON from plain java.util.Properties object.

Exist java.util.Properties object, e.g.:

car.color=blue
car.places=4
car.motor.dimension=2L
car.motor.ps=120

and the target json structur should be:

{
 "car":
  {"color":"blue",
   "places":4,
   "motor":
    {"dimension":"2L",
     "ps":120
    }
  }
}
3 Answers
Related