All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.socrata.soda2.consumer.JValueRowEnumeratee.scala Maven / Gradle / Ivy

The newest version!
package com.socrata.soda2.consumer

import com.rojoma.json.ast._

import com.socrata.iteratee.Iteratee

class JValueRowEnumeratee[T](rowDecoder: JObject => Row, iteratee: Iteratee[Row, T]) extends Iteratee[JValue, T] {
  def process(value: JValue) = value match {
    case rawRow: JObject =>
      val row = rowDecoder(rawRow)
      iteratee.process(row).left.map(new JValueRowEnumeratee(rowDecoder, _))
    case other =>
      throw new InvalidRowJsonException(other, "Found a non-Object in the list of rows")
  }

  def endOfInput() = iteratee.endOfInput()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy