dumpTypeNameToObjectProperty method

void dumpTypeNameToObjectProperty (
  1. JsonMap object,
  2. ClassMirror classMirror,
  3. DeserializationOptions options
)

Implementation

void dumpTypeNameToObjectProperty(
    JsonMap object, ClassMirror classMirror, DeserializationOptions options) {
  final classInfo = ClassInfo(classMirror);
  final Json meta =
      classInfo.metaData.firstWhere((m) => m is Json, orElse: () => null);
  final typeNameProperty = getTypeNameProperty(meta, options);
  if (typeNameProperty != null) {
    final typeInfo = getTypeInfo(classMirror.reflectedType);
    object.setPropertyValue(typeNameProperty, typeInfo.typeName);
  }
}