Packages

o

io.dylemma.spac.json

JacksonSource

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
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JacksonSource
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. 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

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  7. lazy val defaultFactory: JsonFactory

    Default JsonFactory used by the helpers in this object when interfacing with the IntoJacksonJsonParser typeclass to create the underlying Jackson JsonParsers.

    Default JsonFactory used by the helpers in this object when interfacing with the IntoJacksonJsonParser typeclass to create the underlying Jackson JsonParsers.

    This is a new JsonFactory with no additional modifications.

  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. 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

  11. 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

  12. 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

  13. 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

  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  20. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped