java.lang.Object
swim.codec.Encoder<I,O>
swim.codec.DynamicEncoder<I,O>
Dynamically generated
Encoder
continuation.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbind()
Returns the encoded result.protected abstract void
Lifecycle callback invoked after thisDynamicEncoder
has finished encoding avalue
.doEncode()
Returns a newEncoder
continuation for thisDynamicEncoder
, ornull
if thisDynamicEncoder
is done.Returns anEncoder
that represents the continuation of how to encode the giveninput
object.Returns anEncoder
continuation whose behavior may be altered by the given out-of-bandcondition
.pull
(OutputBuffer<?> output) Incrementally encodes as muchoutput
buffer data as possible, and returns anotherEncoder
that represents the continuation of how to write additional buffer data.trap()
Returns the encode error.
-
Field Details
-
encoding
Current encoder continuation.
-
-
Constructor Details
-
DynamicEncoder
public DynamicEncoder()
-
-
Method Details
-
feed
Description copied from class:Encoder
Returns anEncoder
that represents the continuation of how to encode the giveninput
object. -
pull
Description copied from class:Encoder
Incrementally encodes as muchoutput
buffer data as possible, and returns anotherEncoder
that represents the continuation of how to write additional buffer data. IfisLast
istrue
, thenpull
must return a terminatedEncoder
, i.e. anEncoder
in the done state, or in the error state. The givenoutput
buffer is only guaranteed to be valid for the duration of the method call; references tooutput
must not be stored. -
fork
Description copied from class:Encoder
Returns anEncoder
continuation whose behavior may be altered by the given out-of-bandcondition
. -
bind
Description copied from class:Encoder
Returns the encoded result. Only guaranteed to return a result when in the done state. -
trap
Description copied from class:Encoder
Returns the encode error. Only guaranteed to return an error when in the error state. -
doEncode
Returns a newEncoder
continuation for thisDynamicEncoder
, ornull
if thisDynamicEncoder
is done. -
didEncode
Lifecycle callback invoked after thisDynamicEncoder
has finished encoding avalue
.
-