Skip to content

Commit

Permalink
Merge patch from conikeec.
Browse files Browse the repository at this point in the history
From ymasory/jerkson: https://github.com/ymasory/jerkson/pull/2
Register Streaming FieldIterator with Parser Interface
  • Loading branch information
ymasory committed Apr 11, 2013
1 parent d6a109c commit 85076b9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/scala/com/codahale/jerkson/Parser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ trait Parser extends Factory {
new StreamingIterator[A](parser, mf)
}

/**
* Parse a streaming JSON object, returning an iterator of its field name
* and value pairs.
*/
def fields(input: Reader): Iterator[(String, JValue)] = {
val parser = factory.createJsonParser(input)
new FieldIterator(parser)
}

/**
* Returns true if the given class is deserializable.
*/
Expand Down

0 comments on commit 85076b9

Please sign in to comment.