public Base Parse(IElementNavigator nav, Type dataType) { if (nav == null) { throw Error.ArgumentNull(nameof(nav)); } if (dataType == null) { throw Error.ArgumentNull(nameof(dataType)); } var reader = new ElementNavFhirReader(nav, Settings.DisallowXsiAttributesOnRoot); if (dataType.CanBeTreatedAsType(typeof(Resource))) { return(new ResourceReader(reader, Settings).Deserialize()); } else { return(new ComplexTypeReader(reader, Settings).Deserialize(dataType)); } }
// [WMR 20160421] Caller is responsible for disposing reader public Base Parse(JsonReader reader, Type dataType) { IFhirReader jsonReader = new ElementNavFhirReader(JsonDomFhirNavigator.Create(reader, ModelInfo.GetFhirTypeNameForType(dataType))); return(Parse(jsonReader, dataType)); }
// [WMR 20160421] Caller is responsible for disposing reader public Base Parse(XmlReader reader, Type dataType) { IFhirReader xmlReader = new ElementNavFhirReader(XmlDomFhirNavigator.Create(reader), Settings.DisallowXsiAttributesOnRoot); return(Parse(xmlReader, dataType)); }