A composition of a number of "inner" handlers which delegates each event to each (unfinished) inner handler, then reforms a final result based on the final results of each of the inner handlers.
Handler that will produce the result
in response to any input or end event,
and will re-throw any error that gets passed.
Transformer handler that will ignore all inputs, instead passing the given error
exactly once to the downstream handler.
Transformer handler that will ignore all inputs, instead passing the given error
exactly once to the downstream handler.
The input type
The output type
Mapping handler which applies a transformation function to the results coming from the wrapped handler.
Mapping handler which applies a transformation function to inputs before passing them to the downstream handler.
Wraps an inner
handler's methods with a try
, wrapping the output type with Try[_]
A handler that starts with some initial state, and each for each input the
current state is forwarded to the downstream handler, and the state is updated
according to the provided function f
.
A handler that starts with some initial state, and each for each input the
current state is forwarded to the downstream handler, and the state is updated
according to the provided function f
. The final state is passed when
handleEnd
is called.
Handler that forwards inputs to a first handler until that handler yields a result, at which point the result is used to create a second handler, to which all further inputs are forwarded until it yields a result.
Handler that forwards inputs to a first handler until that handler yields a result, at which point the result is used to create a second handler, to which all further inputs are forwarded until it yields a result.
Before the second handler is generated, the input "stack" is tracked so that it can be replayed to the second
handler (so that it can acquire the correct context even though it was not available when the inputs forming
that context were initially handled). The "stack" behavior is generalized with the Stackable
typeclass.
An example usage of this is to faciliate creation of a Parser for an XML element which starts with some "dictionary" element, followed by a large number of "data" objects that reference the dictionary. Normally, a user of xml-spac would have to choose between;
and
The input type
The first handler's result type
The second handler's result type
Created by dylan on 7/9/2016.
Base implementation for Handlers that transform and/or filter inputs before passing them along to some downstream handler.
Base implementation for Handlers that transform and/or filter inputs before passing them along to some downstream handler.
The input type
The transformed input type, which corresponds to the input type of the downstream handler
The downstream handler's output type
Unwraps an inner
handler whose output type is a Try
, so that any Failure
returned from
the inner handler will have its underlying error thrown.
Handler that delegates to an inner
handler, converting result-typed inputs
to the corresponding handleInput
or handleError
call.
Handler that upgrades events from the upstream to Results
before passing them
to the inner handler.
Handler that upgrades events from the upstream to Results
before passing them
to the inner handler. This way, the inner handler will never have its handleError
method called.
A composition of a number of "inner" handlers which delegates each event to each (unfinished) inner handler, then reforms a final result based on the final results of each of the inner handlers.
Used internally by
ParserChain
The input type for each of the inner handlers
A base type for the results of all of the innerHandlers. This will typically be
Any
orResult[Any]
.The type of the final combined result