- java.lang.Object
-
- swim.codec.Decoder<O>
-
- swim.codec.DynamicDecoder<O>
-
-
Constructor Summary
Constructors Constructor Description DynamicDecoder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description O
bind()
Returns the decoded result.protected abstract void
didDecode(O value)
Lifecycle callback invoked after thisDynamicDecoder
has finished decoding avalue
.protected abstract Decoder<? extends O>
doDecode()
Returns a newDecoder
continuation for thisDynamicDecoder
, ornull
if thisDynamicDecoder
is done.Decoder<O>
feed(InputBuffer input)
Incrementally decodes as muchinput
buffer data as possible, and returns anotherDecoder
that represents the continuation of how to decode additional buffer data.Decoder<O>
fork(Object condition)
Returns aDecoder
continuation whose behavior may be altered by the given out-of-bandcondition
.Throwable
trap()
Returns the decode error.
-
-
-
Method Detail
-
feed
public Decoder<O> feed(InputBuffer input)
Description copied from class:Decoder
Incrementally decodes as muchinput
buffer data as possible, and returns anotherDecoder
that represents the continuation of how to decode additional buffer data. IfisLast
istrue
, thenfeed
must return a terminatedDecoder
, i.e. aDecoder
in the done state, or in the error state. The giveninput
buffer is only guaranteed to be valid for the duration of the method call; references toinput
must not be stored.
-
fork
public Decoder<O> fork(Object condition)
Description copied from class:Decoder
Returns aDecoder
continuation whose behavior may be altered by the given out-of-bandcondition
.
-
bind
public O bind()
Description copied from class:Decoder
Returns the decoded result. Only guaranteed to return a result when in the done state.
-
trap
public Throwable trap()
Description copied from class:Decoder
Returns the decode error. Only guaranteed to return an error when in the error state.
-
doDecode
protected abstract Decoder<? extends O> doDecode()
Returns a newDecoder
continuation for thisDynamicDecoder
, ornull
if thisDynamicDecoder
is done.
-
didDecode
protected abstract void didDecode(O value)
Lifecycle callback invoked after thisDynamicDecoder
has finished decoding avalue
.
-
-