JsonDecoder class abstract

A JSON decoder.

Inheritance

Constructors

JsonDecoder({JsonValueDecoderProvider? jsonValueDecoderProvider, JsomMapDecoderProvider? jsomMapDecoderProvider, JsomMapDecoder? jsomMapDecoder, JsomMapDecoderAsyncProvider? jsomMapDecoderAsyncProvider, JsomMapDecoderAsync? jsomMapDecoderAsync, IterableCaster? iterableCaster, MapCaster? mapCaster, JsonEntityCache? entityCache, bool forceDuplicatedEntitiesAsID = false, bool autoResetEntityCache = true})
factory

Properties

autoResetEntityCache bool
Returns true if the entity cache is automatically reset for each decoding session.
no setter
entityCache JsonEntityCache
The internal entity cache.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

bind(Stream<String> stream) Stream<Object?>
Transforms the provided stream.
inherited
cast<RS, RT>() Converter<RS, RT>
Provides a Converter<RS, RT> view of this stream transformer.
inherited
convert(String input) Object?
Converts input and returns the result of the conversion.
inherited
decode<T>(String encodedJson, {Type? type, TypeInfo? typeInfo, bool duplicatedEntitiesAsID = false, bool? autoResetEntityCache}) → T
Decodes encodedJson to a JSON collection/data.
decodeAsync<T>(FutureOr<String> encodedJson, {Type? type, TypeInfo? typeInfo, bool duplicatedEntitiesAsID = false, bool? autoResetEntityCache}) FutureOr<T>
Decodes encodedJson to a JSON collection/data accepting async values.
decodeFromBytes<T>(Uint8List encodedJsonBytes, {Type? type, TypeInfo? typeInfo, bool duplicatedEntitiesAsID = false, bool? autoResetEntityCache}) → T
Sames as decode but from a Uint8List.
decodeFromBytesAsync<T>(FutureOr<Uint8List> encodedJsonBytes, {Type? type, TypeInfo? typeInfo, bool duplicatedEntitiesAsID = false, bool? autoResetEntityCache}) FutureOr<T>
Sames as decodeAsync but from a Uint8List.
fromJson<O>(Object? o, {Type? type, TypeInfo? typeInfo, bool duplicatedEntitiesAsID = false, bool? autoResetEntityCache}) → O?
Converts o to type.
fromJsonAsync<O>(Object? o, {Type? type, TypeInfo? typeInfo, bool duplicatedEntitiesAsID = false, bool? autoResetEntityCache}) FutureOr<O?>
Converts o to type allowing async calls (Future and FutureOr).
fromJsonList<O>(Iterable o, {Type? type, TypeInfo? typeInfo, bool duplicatedEntitiesAsID = false, bool? autoResetEntityCache}) List<O?>
Converts o to as List of type.
fromJsonListAsync<O>(FutureOr<Iterable> o, {Type? type, TypeInfo? typeInfo, bool duplicatedEntitiesAsID = false, bool? autoResetEntityCache}) FutureOr<List<O?>>
Converts o to as List of type allowing async calls (Future and FutureOr).
fromJsonMap<O>(Map<String, Object?> map, {Type? type, TypeInfo? typeInfo, bool duplicatedEntitiesAsID = false, bool? autoResetEntityCache}) → O
Converts map to type.
fromJsonMapAsync<O>(FutureOr<Map<String, Object?>> map, {Type? type, TypeInfo? typeInfo, bool duplicatedEntitiesAsID = false, bool? autoResetEntityCache}) FutureOr<O>
Converts map to type allowing async calls (Future and FutureOr).
fuse<TT>(Converter<Object?, TT> other) Converter<String, TT>
Fuses this with other.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resetEntityCache() → void
Resets the entities cache used to resolve duplicated entities in the same tree.
startChunkedConversion(Sink<Object?> sink) Sink<String>
Starts a chunked conversion.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

defaultDecoder JsonDecoder
final

Static Methods

getTypeDecoder(Type type) JsonTypeDecoder?
registerTypeDecoder(Type type, JsonTypeDecoder decoder) → void
Register a global JsonTypeDecoder for type.
removeTypeDecoder(Type type) JsonTypeDecoder?
unregisterTypeDecoder(Type type, [JsonTypeDecoder? decoder]) bool
Unregister a global JsonTypeDecoder for type.