OverriddenMember.fromJson constructor

OverriddenMember.fromJson(
  1. JsonDecoder jsonDecoder,
  2. String jsonPath,
  3. Object? json
)

Implementation

factory OverriddenMember.fromJson(
    JsonDecoder jsonDecoder, String jsonPath, Object? json) {
  json ??= {};
  if (json is Map) {
    Element element;
    if (json.containsKey('element')) {
      element =
          Element.fromJson(jsonDecoder, '$jsonPath.element', json['element']);
    } else {
      throw jsonDecoder.mismatch(jsonPath, 'element');
    }
    String className;
    if (json.containsKey('className')) {
      className =
          jsonDecoder.decodeString('$jsonPath.className', json['className']);
    } else {
      throw jsonDecoder.mismatch(jsonPath, 'className');
    }
    return OverriddenMember(element, className);
  } else {
    throw jsonDecoder.mismatch(jsonPath, 'OverriddenMember', json);
  }
}