Rename FlowMaterializer to Materializer
This commit is contained in:
parent
dc7269e620
commit
7879a5521b
245 changed files with 860 additions and 860 deletions
|
|
@ -5,7 +5,7 @@
|
|||
package akka.http.scaladsl.marshallers.sprayjson
|
||||
|
||||
import scala.language.implicitConversions
|
||||
import akka.stream.FlowMaterializer
|
||||
import akka.stream.Materializer
|
||||
import akka.http.scaladsl.marshalling.{ ToEntityMarshaller, Marshaller }
|
||||
import akka.http.scaladsl.unmarshalling.{ FromEntityUnmarshaller, Unmarshaller }
|
||||
import akka.http.scaladsl.model.{ ContentTypes, HttpCharsets }
|
||||
|
|
@ -16,11 +16,11 @@ import spray.json._
|
|||
* A trait providing automatic to and from JSON marshalling/unmarshalling using an in-scope *spray-json* protocol.
|
||||
*/
|
||||
trait SprayJsonSupport {
|
||||
implicit def sprayJsonUnmarshallerConverter[T](reader: RootJsonReader[T])(implicit mat: FlowMaterializer): FromEntityUnmarshaller[T] =
|
||||
implicit def sprayJsonUnmarshallerConverter[T](reader: RootJsonReader[T])(implicit mat: Materializer): FromEntityUnmarshaller[T] =
|
||||
sprayJsonUnmarshaller(reader, mat)
|
||||
implicit def sprayJsonUnmarshaller[T](implicit reader: RootJsonReader[T], mat: FlowMaterializer): FromEntityUnmarshaller[T] =
|
||||
implicit def sprayJsonUnmarshaller[T](implicit reader: RootJsonReader[T], mat: Materializer): FromEntityUnmarshaller[T] =
|
||||
sprayJsValueUnmarshaller.map(jsonReader[T].read)
|
||||
implicit def sprayJsValueUnmarshaller(implicit mat: FlowMaterializer): FromEntityUnmarshaller[JsValue] =
|
||||
implicit def sprayJsValueUnmarshaller(implicit mat: Materializer): FromEntityUnmarshaller[JsValue] =
|
||||
Unmarshaller.byteStringUnmarshaller.forContentTypes(`application/json`).mapWithCharset { (data, charset) ⇒
|
||||
val input =
|
||||
if (charset == HttpCharsets.`UTF-8`) ParserInput(data.toArray)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import java.io.{ ByteArrayInputStream, InputStreamReader }
|
|||
import javax.xml.parsers.{ SAXParserFactory, SAXParser }
|
||||
import scala.collection.immutable
|
||||
import scala.xml.{ XML, NodeSeq }
|
||||
import akka.stream.FlowMaterializer
|
||||
import akka.stream.Materializer
|
||||
import akka.http.scaladsl.unmarshalling._
|
||||
import akka.http.scaladsl.marshalling._
|
||||
import akka.http.scaladsl.model._
|
||||
|
|
@ -21,10 +21,10 @@ trait ScalaXmlSupport {
|
|||
def nodeSeqMarshaller(contentType: ContentType): ToEntityMarshaller[NodeSeq] =
|
||||
Marshaller.StringMarshaller.wrap(contentType)(_.toString())
|
||||
|
||||
implicit def defaultNodeSeqUnmarshaller(implicit fm: FlowMaterializer): FromEntityUnmarshaller[NodeSeq] =
|
||||
implicit def defaultNodeSeqUnmarshaller(implicit fm: Materializer): FromEntityUnmarshaller[NodeSeq] =
|
||||
nodeSeqUnmarshaller(ScalaXmlSupport.nodeSeqContentTypeRanges: _*)
|
||||
|
||||
def nodeSeqUnmarshaller(ranges: ContentTypeRange*)(implicit fm: FlowMaterializer): FromEntityUnmarshaller[NodeSeq] =
|
||||
def nodeSeqUnmarshaller(ranges: ContentTypeRange*)(implicit fm: Materializer): FromEntityUnmarshaller[NodeSeq] =
|
||||
Unmarshaller.byteArrayUnmarshaller.forContentTypes(ranges: _*).mapWithCharset { (bytes, charset) ⇒
|
||||
if (bytes.length > 0) {
|
||||
val reader = new InputStreamReader(new ByteArrayInputStream(bytes), charset.nioCharset)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue