diff options
author | Mathias <mathias@spray.cc> | 2011-11-30 16:07:43 +0100 |
---|---|---|
committer | Mathias <mathias@spray.cc> | 2011-11-30 16:15:12 +0100 |
commit | 938576d2859f3749a357c96ac7a9be6c5fd4ec7e (patch) | |
tree | 9da1dfc0ae49831927acb57cfb66bc66f10cc85c /src/main/scala/cc/spray/json/JsonFormat.scala | |
parent | cf840bcbe341a2976ea8ea9afefa157bf426e9f8 (diff) | |
download | spray-json-938576d2859f3749a357c96ac7a9be6c5fd4ec7e.tar.gz spray-json-938576d2859f3749a357c96ac7a9be6c5fd4ec7e.tar.bz2 spray-json-938576d2859f3749a357c96ac7a9be6c5fd4ec7e.zip |
Add RootJsonReader and RootJsonWriter as well as some helper methods, closes #10
Diffstat (limited to 'src/main/scala/cc/spray/json/JsonFormat.scala')
-rw-r--r-- | src/main/scala/cc/spray/json/JsonFormat.scala | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/scala/cc/spray/json/JsonFormat.scala b/src/main/scala/cc/spray/json/JsonFormat.scala index 01b9f80..683a823 100644 --- a/src/main/scala/cc/spray/json/JsonFormat.scala +++ b/src/main/scala/cc/spray/json/JsonFormat.scala @@ -53,7 +53,19 @@ object JsonWriter { trait JsonFormat[T] extends JsonReader[T] with JsonWriter[T] /** + * A special JsonReader capable of reading a legal JSON root object, i.e. either a JSON array or a JSON object. + */ +@implicitNotFound(msg = "Cannot find RootJsonReader or RootJsonFormat type class for ${T}") +trait RootJsonReader[T] extends JsonReader[T] + +/** + * A special JsonWriter capable of writing a legal JSON root object, i.e. either a JSON array or a JSON object. + */ +@implicitNotFound(msg = "Cannot find RootJsonWriter or RootJsonFormat type class for ${T}") +trait RootJsonWriter[T] extends JsonWriter[T] + +/** * A special JsonFormat signaling that the format produces a legal JSON root object, i.e. either a JSON array * or a JSON object. */ -trait RootJsonFormat[T] extends JsonFormat[T]
\ No newline at end of file +trait RootJsonFormat[T] extends JsonFormat[T] with RootJsonReader[T] with RootJsonWriter[T]
\ No newline at end of file |