object JacksonSource
Provides helpers for creating fs2.Stream
and Iterator
instances of JsonEvent
from various underlying event sources,
using the Jackson library as the underlying event parser.
The helpers in this object operate in terms of the IntoJacksonJsonParser
typeclass, which defines logic for
using a source
value to construct a Jackson JsonParser in a Resource. From there, the helpers take care of
converting the jackson parser/event model to the spac JsonEvent model.
For example:
val file = new File("./stuff.json") val jsonStream: Stream[IO, JsonEvent] = JacksonSource[IO](file)
- Source
- JacksonSource.scala
- Alphabetic
- By Inheritance
- JacksonSource
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply(jacksonParser: com.fasterxml.jackson.core.JsonParser): Source[JsonEvent]
Wrap an existing Jackson JsonParser as a single-use source of JsonEvents.
Wrap an existing Jackson JsonParser as a single-use source of JsonEvents.
The source will *not* attempt to close the underlying parser.
- jacksonParser
A Jackson JsonParser
- returns
A single-use JSON event source
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- lazy val defaultFactory: JsonFactory
Default
JsonFactory
used by the helpers in this object when interfacing with theIntoJacksonJsonParser
typeclass to create the underlying Jackson JsonParsers.Default
JsonFactory
used by the helpers in this object when interfacing with theIntoJacksonJsonParser
typeclass to create the underlying Jackson JsonParsers.This is a
new JsonFactory
with no additional modifications. - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fromFile(file: File, factory: JsonFactory = defaultFactory): Source[JsonEvent]
Creates a new Source that reads JsonEvents from the given file.
Creates a new Source that reads JsonEvents from the given file.
- file
A JSON file
- factory
A Jackson JsonFactory used to construct the underlying JsonParser for the string
- returns
A reusable JSON event source
- def fromInputStream(stream: InputStream, factory: JsonFactory = defaultFactory): Source[JsonEvent]
Wrap an InputStream as a single-use source of JsonEvents.
Wrap an InputStream as a single-use source of JsonEvents.
The Source will *not* attempt to close the input stream.
- stream
An InputStream over raw JSON bytes
- factory
A Jackson JsonFactory used to construct the underlying JsonParser for the string
- returns
A single-use JSON event source
- def fromReader(reader: Reader, factory: JsonFactory = defaultFactory): Source[JsonEvent]
Wrap a
Reader
as a single-use source of JsonEvents.Wrap a
Reader
as a single-use source of JsonEvents.The Source will *not* attempt to close the reader.
- reader
A Reader over characters of raw JSON
- factory
A Jackson JsonFactory used to construct the underlying JsonParser for the string
- returns
A single-use JSON event source
- def fromString(rawJson: String, factory: JsonFactory = defaultFactory): Source[JsonEvent]
Wrap a string of raw JSON as a source of JsonEvents
Wrap a string of raw JSON as a source of JsonEvents
- rawJson
A string containing raw JSON
- factory
A Jackson JsonFactory used to construct the underlying JsonParser for the string
- returns
A reusable JSON event source
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()