The decoding options
A Cursor
of Feature
s corresponding to the
server response. All Features
should be defined in the same reference.
a Cursor
of LuciadRIA Feature
s which must be encoded to
the arbitrary representation
The encoded version of the features
The encoded content as a string
The mime type describing how the content was encoded as a string
Encodes Feature instances to an arbitrary format and decodes that arbitrary format to LuciadRIA Feature instances.
A
Codec
is typically used by a Store to decode the server response and to encode the LuciadRIAFeatures
so they can be sent back to the server. Consult the class documentation of theStore
class for more information.Note: most of the methods in the API are optional. The presence of such an optional method indicates support for that feature. For instance a
Store
which is read-only only needs aCodec
which provides adecode
method but does not need anencode
method. It is up to theStore
implementations to clearly document which methods they require to be present on theCodec
.Users of this class should always check whether such an optional method is available before calling the method, as illustrated below:
Codec codec = ...; if ( typeof codec.encode === "function" ){ //encode method is available and can be called codec.encode( ... ); }