public ResponseEncoding(FhirContext theCtx, EncodingEnum theEncoding, String theContentType) { super(); myEncoding = theEncoding; myContentType = theContentType; if (theContentType != null) { FhirVersionEnum ctxtEnum = theCtx.getVersion().getVersion(); if (theContentType.equals(EncodingEnum.JSON_PLAIN_STRING) || theContentType.equals(EncodingEnum.XML_PLAIN_STRING)) { myNonLegacy = ctxtEnum.isNewerThan(FhirVersionEnum.DSTU2_1); } else { myNonLegacy = ctxtEnum.isNewerThan(FhirVersionEnum.DSTU2_1) && !EncodingEnum.isLegacy(theContentType); } } else { FhirVersionEnum ctxtEnum = theCtx.getVersion().getVersion(); if (ctxtEnum.isOlderThan(FhirVersionEnum.DSTU3)) { myNonLegacy = null; } else { myNonLegacy = Boolean.TRUE; } } }
public ResponseEncoding(FhirContext theCtx, EncodingEnum theEncoding, String theContentType) { super(); myEncoding = theEncoding; myContentType = theContentType; if (theContentType != null) { FhirVersionEnum ctxtEnum = theCtx.getVersion().getVersion(); if (theContentType.equals(EncodingEnum.JSON_PLAIN_STRING) || theContentType.equals(EncodingEnum.XML_PLAIN_STRING)) { myNonLegacy = ctxtEnum.isNewerThan(FhirVersionEnum.DSTU2_1); } else { myNonLegacy = ctxtEnum.isNewerThan(FhirVersionEnum.DSTU2_1) && !EncodingEnum.isLegacy(theContentType); } } else { FhirVersionEnum ctxtEnum = theCtx.getVersion().getVersion(); if (ctxtEnum.isOlderThan(FhirVersionEnum.DSTU3)) { myNonLegacy = null; } else { myNonLegacy = Boolean.TRUE; } } }