JsonEncoder class abstract
A JSON encoder.
- Inheritance
-
- Object
- JsonConverter<
Object?, String> - JsonEncoder
Constructors
- JsonEncoder({JsonFieldMatcher? maskField, String maskText = '***', JsonFieldMatcher? removeField, bool removeNullFields = false, ToEncodableJsonProvider? toEncodableProvider, ToEncodableJson? toEncodable, JsonEntityCache? entityCache, bool forceDuplicatedEntitiesAsID = false, dynamic autoResetEntityCache = true})
-
factory
Properties
- autoResetEntityCache → bool
-
Returns
trueif the entity cache is automatically reset for each encoding session.no setter - entityCache → JsonEntityCache?
-
The JsonEntityCache of this encoder.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isStandard → bool
-
Returns
trueif this instance's configuration is equivalent to the default configuration.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
bind(
Stream< Object?> stream) → Stream<String> -
Transforms the provided
stream.inherited -
cast<
RS, RT> () → Converter< RS, RT> -
Provides a
Converter<RS, RT>view of this stream transformer.inherited -
convert(
Object? input) → String -
Converts
inputand returns the result of the conversion.inherited -
encode(
Object? o, {bool pretty = false, bool duplicatedEntitiesAsID = false, bool? autoResetEntityCache}) → String -
Transforms
oto an encoded JSON. -
encodeToBytes(
Object? o, {bool pretty = false, bool duplicatedEntitiesAsID = false, bool? autoResetEntityCache}) → Uint8List - Sames as encode but returns a Uint8List.
-
encodeToSink(
Object? o, Sink< List< sink, {bool pretty = false, bool duplicatedEntitiesAsID = false, bool? autoResetEntityCache}) → voidint> > -
Sames as encodeToBytes but outputs to a
sink. -
fuse<
TT> (Converter< String, TT> other) → Converter<Object?, TT> -
Fuses
thiswithother.inherited -
mapToJson(
Map map, {bool duplicatedEntitiesAsID = false, bool? autoResetEntityCache}) → Map< String, dynamic> -
Converts
maptree to a JSON. -
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< String> sink) → Sink<Object?> -
Starts a chunked conversion.
inherited
-
toJson<
T> (Object? o, {bool duplicatedEntitiesAsID = false, bool? autoResetEntityCache}) → T? -
Converts
oto a JSON collection/data. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- defaultEncoder → JsonEncoder
-
final
Static Methods
-
callToJson(
dynamic o, {Object? fallback(dynamic o)?}) → Object? -
Calls
o.toJsonin a performatic way, avoiding NoSuchMethodError and noSuchMethod calls. -
getTypeToEncodable(
Type type) → ToEncodableJson? -
registerTypeToEncodable(
Type type, ToEncodableJson toEncodable) → void -
removeTypeToEncodable(
Type type) → ToEncodableJson?