JsonCodec constructor
JsonCodec({
- JsonFieldMatcher? maskField,
- String maskText = '***',
- JsonFieldMatcher? removeField,
- bool removeNullFields = false,
- ToEncodableJsonProvider? toEncodableProvider,
- ToEncodableJson? toEncodable,
- JsonValueDecoderProvider? jsonValueDecoderProvider,
- JsomMapDecoderProvider? jsomMapDecoderProvider,
- JsomMapDecoder? jsomMapDecoder,
- JsomMapDecoderAsyncProvider? jsomMapDecoderAsyncProvider,
- JsomMapDecoderAsync? jsomMapDecoderAsync,
- IterableCaster? iterableCaster,
- MapCaster? mapCaster,
- JsonEntityCache? entityCache,
- bool forceDuplicatedEntitiesAsID = false,
- dynamic autoResetEntityCache = true,
Implementation
factory JsonCodec(
{JsonFieldMatcher? maskField,
String maskText = '***',
JsonFieldMatcher? removeField,
bool removeNullFields = false,
ToEncodableJsonProvider? toEncodableProvider,
ToEncodableJson? toEncodable,
JsonValueDecoderProvider? jsonValueDecoderProvider,
JsomMapDecoderProvider? jsomMapDecoderProvider,
JsomMapDecoder? jsomMapDecoder,
JsomMapDecoderAsyncProvider? jsomMapDecoderAsyncProvider,
JsomMapDecoderAsync? jsomMapDecoderAsync,
IterableCaster? iterableCaster,
MapCaster? mapCaster,
JsonEntityCache? entityCache,
bool forceDuplicatedEntitiesAsID = false,
autoResetEntityCache = true}) {
if (maskField == null &&
removeField == null &&
!removeNullFields &&
toEncodableProvider == null &&
toEncodable == null &&
jsomMapDecoderProvider == null &&
jsomMapDecoder == null &&
jsomMapDecoderAsyncProvider == null &&
jsomMapDecoderAsync == null &&
iterableCaster == null &&
mapCaster == null &&
entityCache == null &&
!forceDuplicatedEntitiesAsID &&
autoResetEntityCache) {
return defaultCodec;
}
return JsonCodec._(
_JsonEncoder(
maskField,
maskText,
removeField,
removeNullFields,
toEncodableProvider,
toEncodable,
entityCache,
forceDuplicatedEntitiesAsID,
autoResetEntityCache),
_JsonDecoder(
jsonValueDecoderProvider,
jsomMapDecoderProvider,
jsomMapDecoder,
jsomMapDecoderAsyncProvider,
jsomMapDecoderAsync,
iterableCaster,
mapCaster,
entityCache,
forceDuplicatedEntitiesAsID,
autoResetEntityCache));
}