Api.fromJson constructor

Api.fromJson(
  1. Map _json
)

Implementation

Api.fromJson(core.Map _json) {
  if (_json.containsKey("methods")) {
    methods = (_json["methods"] as core.List)
        .map<Method>((value) => new Method.fromJson(value))
        .toList();
  }
  if (_json.containsKey("mixins")) {
    mixins = (_json["mixins"] as core.List)
        .map<Mixin>((value) => new Mixin.fromJson(value))
        .toList();
  }
  if (_json.containsKey("name")) {
    name = _json["name"];
  }
  if (_json.containsKey("options")) {
    options = (_json["options"] as core.List)
        .map<Option>((value) => new Option.fromJson(value))
        .toList();
  }
  if (_json.containsKey("sourceContext")) {
    sourceContext = new SourceContext.fromJson(_json["sourceContext"]);
  }
  if (_json.containsKey("syntax")) {
    syntax = _json["syntax"];
  }
  if (_json.containsKey("version")) {
    version = _json["version"];
  }
}