Skip to content

Commit

Permalink
better comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Voitot committed Apr 12, 2012
1 parent 30affd1 commit 7ed4b6f
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions framework/src/play/src/main/scala/play/api/libs/json/Json.scala
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -36,9 +36,22 @@ object Json {
def fromJson[T](json: JsValue)(implicit fjs: Reads[T]): T = fjs.reads(json) def fromJson[T](json: JsValue)(implicit fjs: Reads[T]): T = fjs.reads(json)


/* /*
* Rich Json syntax allows : * Next is the trait that allows Simplified Json syntax :
* JsObject(Seq("key", JsString("value")) ====> Json.obj( "key1" -> "value", "key2" -> 123, "key3" -> obj("key31" -> "value31")) *
* JsArray(JsString("value"), JsNumber(123), JsBoolean(true)) ====> Json.arr( "value", 123, true ) * Example :
* JsObject(Seq(
* "key1", JsString("value"),
* "key2" -> JsNumber(123),
* "key3" -> JsObject(Seq("key31" -> JsString("value31")))
* ))
* ====> Json.obj( "key1" -> "value", "key2" -> 123, "key3" -> obj("key31" -> "value31"))
*
* JsArray(JsString("value"), JsNumber(123), JsBoolean(true))
* ====> Json.arr( "value", 123, true )
*
* There is an implicit conversion from any Type to JsValueWrapper which is an empty trait that
* shouldn't end into unexpected implicit conversions
*
*/ */
trait JsValueWrapper trait JsValueWrapper


Expand Down

0 comments on commit 7ed4b6f

Please sign in to comment.