JsonMapper class

Singleton class providing static methods for Dart objects conversion from / to JSON string

Constructors

JsonMapper()
factory

Properties

adapters Map<int, IAdapter>
final
classes Map<String, ClassMirror>
final
converters Map<Type, ICustomConverter>
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
jsonDecoder JsonDecoder
final
processedObjects Map<String, ProcessedObjectDescriptor>
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
serializable JsonSerializable
final
typeInfoDecorators Map<int, ITypeInfoDecorator>
read-only
valueDecorators Map<Type, ValueDecoratorFunction>
read-only

Methods

applyValueDecorator(dynamic value, TypeInfo typeInfo, [JsonProperty meta]) → dynamic
configureConverter(ICustomConverter converter, {dynamic value, SerializationContext serializationContext, DeserializationContext deserializationContext}) → void
deserializeIterable(dynamic jsonValue, DeserializationContext context) Object
deserializeObject(dynamic jsonValue, DeserializationContext context) Object
detectObjectType(dynamic objectInstance, Type objectType, JsonMap objectJsonMap, DeserializationOptions options) TypeInfo
dumpTypeNameToObjectProperty(JsonMap object, ClassMirror classMirror, DeserializationOptions options) → void
enumerateConstructorParameters(ClassMirror classMirror, DeserializationOptions options, Function visitor) → void
enumeratePublicProperties(InstanceMirror instanceMirror, JsonMap jsonMap, DeserializationOptions options, Function visitor) → void
getConverter(JsonProperty jsonProperty, Type declarationType, [Type valueType, InstanceMirror im]) ICustomConverter
getDeclarationType(DeclarationMirror mirror) Type
getNamedArguments(ClassMirror cm, JsonMap jsonMap, [DeserializationContext context]) Map<Symbol, dynamic>
getObjectKey(Object object) String
getObjectProcessed(Object object, int level) ProcessedObjectDescriptor
getPositionalArguments(ClassMirror cm, JsonMap jsonMap, [DeserializationContext context]) List
getScalarType(Type type) Type
getTypeInfo(Type type) TypeInfo
getTypeNameProperty(Json meta, DeserializationOptions options) String
getValueDecorator(JsonProperty jsonProperty, Type type) ValueDecoratorFunction
info() → void
isFieldIgnored([dynamic value, Json classMeta, JsonProperty meta, DeserializationOptions options]) bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
removeAdapter(IAdapter adapter) JsonMapper
safeGetInstanceMirror(Object object) InstanceMirror
serializeIterable(Iterable object, SerializationContext context) → dynamic
serializeObject(Object object, SerializationContext context) → dynamic
toString() String
Returns a string representation of this object.
inherited
useAdapter(IAdapter adapter, [int priority]) JsonMapper

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Static Properties

instance JsonMapper
final

Static Methods

clone<T>(T object) → T
Clone Dart object of type T
deserialize<T>(dynamic jsonValue, [DeserializationOptions options = defaultDeserializationOptions]) → T
Converts JSON string to Dart object of type T
fromJson<T>(dynamic jsonValue, [DeserializationOptions options = defaultDeserializationOptions]) → T
Converts JSON string to Dart object of type T
fromMap<T>(Map<String, dynamic> map, [SerializationOptions options = defaultSerializationOptions]) → T
Converts Map<String, dynamic> to Dart object instance
serialize(Object object, [SerializationOptions options = defaultSerializationOptions]) String
Converts Dart object to JSON string
toJson(Object object, [SerializationOptions options = defaultSerializationOptions]) String
Converts Dart object to JSON string
toMap(Object object, [SerializationOptions options = defaultSerializationOptions]) Map<String, dynamic>
Converts Dart object to Map<String, dynamic>