Packages

  • package root
    Definition Classes
    root
  • package io
    Definition Classes
    root
  • package dylemma
    Definition Classes
    io
  • package spac

    SPaC (short for "Streaming Parser Combinators") is a library for building stream consumers in a declarative style, specialized for tree-like data types like XML and JSON.

    SPaC (short for "Streaming Parser Combinators") is a library for building stream consumers in a declarative style, specialized for tree-like data types like XML and JSON.

    Many utilities for handling XML and JSON data involve parsing the entire "document" to some DOM model, then inspecting and transforming that model to extract information. The downside to these utilities is that when the document is very large, the DOM may not fit in memory. The workaround for this type of problem is to treat the document as a stream of "events", e.g. "StartElement" and "EndElement" for XML, or "StartObject" and "EndObject" for JSON. The downside to this workaround is that writing code to handle these streams can be complicated and error-prone, especially when the DOM is complicated.

    SPaC's goal is to drastically simplify the process of creating code to handle these streams.

    This package contains the "core" SPaC traits; Parser, Transformer, Splitter, and ContextMatcher.

    See the xml and json subpackages (provided by the xml-spac and json-spac libraries respectively) for specific utilities related to handling XML and JSON event streams.

    Definition Classes
    dylemma
  • object Transformer

    Definition Classes
    spac
  • BoundHandler
  • Handler
  • HandlerLinkage
  • HandlerWrite
  • Stateless
  • TransformerKVParsingOps
  • TransformerParsingOps

object Handler

Source
Transformer.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Handler
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def bindDownstream[In, Out](inner: Handler[In, Out], downstream: BoundHandler[Out]): BoundHandler[In]

    Combine a handler with a predetermined "downstream", creating a BoundHandler whose push and finish methods delegate to that downstream receiver instead of needing to accept one as a parameter.

    Combine a handler with a predetermined "downstream", creating a BoundHandler whose push and finish methods delegate to that downstream receiver instead of needing to accept one as a parameter.

    This is useful for implementing more complex handlers, or when interfacing with a Transformer without a Parser, e.g. in order to collect outputs from a transformer into a buffer.

    In

    The input event type

    Out

    The output event type

    inner

    The "upstream" handler

    downstream

    The "downstream" handler which will receive outputs from inner

    returns

    A sink for In events which uses the inner handler to receive events, and the downstream handler to receive outputs from inner

  6. def bindVariableDownstream[In, Out](inner: Handler[In, Out]): BoundHandler[In] with HandlerLinkage[Out]

    Combine an existing handler with a variable "downstream" handler, creating a BoundHandler whose push and finish methods delegate to whatever the current "downstream" is, instead of needing to accept the downstream as a parameter.

    Combine an existing handler with a variable "downstream" handler, creating a BoundHandler whose push and finish methods delegate to whatever the current "downstream" is, instead of needing to accept the downstream as a parameter.

    This is similar to bindDownstream except that you can swap out the actual downstream handler at any time. This primarily exists as a helper for wiring chains of transformers together; you probably don't want to use this directly.

  7. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. def protect[In, Out](inner: Handler[In, Out]): Handler[In, Out]

    Wrap an existing transformer handler, protecting it from misuse of the Handler interface methods.

    Wrap an existing transformer handler, protecting it from misuse of the Handler interface methods. The returned handler guarantees that once the inner handler returns a Stop signal, throws an exception, or is told to finish(), the returned handler will no-op for subsequent calls to finish or push.

    Furthermore, exceptions thrown by the inner handler will be passed to the inner handler's bubbleUp method, allowing for possible transformation of errors thrown by the inner handler as if that inner handler had try/catch wrappers around all of its own logic.

    In

    The input event type

    Out

    The output event type

    inner

    The handler to wrap

    returns

    A new handler which wraps the inner one, protecting it against interface misuse.

  18. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped