Simple Scala Json Parser using scala reflection.
- Not good performance. ( jackson library is 3 times faster than this library )
- json to T.
- T to json.
- You can add default Json ++ your extra json. ( override extraJson function )
* It is just for studying reflection. But this library does not have any problems.
case class YourCustomClass(param1: Int, param2: String)
//extends Mode
val yourCustomClass = yourCustomClass(0, "5")
YourCustomClass extends SimpleJsonParser
val jsonValue = yourCustomClass.toJson
val objectValue = yourCustomClass.fromJson(jsonValue)
//standalone Mode
val yourCustomClass = yourCustomClass(0, "5")
val jsonValue = SimpleJsonParser.toJson(yourCustomClass)
val objectValue = SimpleJsonParser.fromJson(jsonValue, classOf[yourCustomClass])
override def extraJson = Json.obj("extraJson" -> 1, ......)
yourCustomClass.toJson