public enum EncodingEnum extends Enum<EncodingEnum>
| Modifier and Type | Field and Description |
|---|---|
static String |
JSON_PLAIN_STRING
"json"
|
static String |
XML_PLAIN_STRING
"xml"
|
| Modifier and Type | Method and Description |
|---|---|
static EncodingEnum |
detectEncoding(String theBody) |
static EncodingEnum |
detectEncodingNoDefault(String theBody) |
static EncodingEnum |
forContentType(String theContentType)
Returns the encoding for a given content type, or
null if no encoding
is found. |
static EncodingEnum |
forContentTypeStrict(String theContentType)
Returns the encoding for a given content type, or
null if no encoding
is found. |
String |
getFormatContentType() |
String |
getRequestContentType() |
String |
getResourceContentType()
Will return application/xml+fhir style
|
String |
getResourceContentTypeNonLegacy()
Will return application/fhir+xml style
|
static boolean |
isNonLegacy(String theFormat) |
abstract IParser |
newParser(FhirContext theContext) |
static EncodingEnum |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static EncodingEnum[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final EncodingEnum JSON
public static final EncodingEnum XML
public static final String JSON_PLAIN_STRING
public static final String XML_PLAIN_STRING
public static EncodingEnum[] values()
for (EncodingEnum c : EncodingEnum.values()) System.out.println(c);
public static EncodingEnum valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String getFormatContentType()
public String getRequestContentType()
public String getResourceContentType()
public String getResourceContentTypeNonLegacy()
public abstract IParser newParser(FhirContext theContext)
public static EncodingEnum detectEncoding(String theBody)
public static EncodingEnum detectEncodingNoDefault(String theBody)
public static EncodingEnum forContentType(String theContentType)
null if no encoding
is found.
This method is lenient! Things like "application/xml" will return XML
even if the "+fhir" part is missing from the expected content type.
public static EncodingEnum forContentTypeStrict(String theContentType)
null if no encoding
is found.
This method is NOT lenient! Things like "application/xml" will return null
forContentType(String)public static boolean isNonLegacy(String theFormat)
Copyright © 2014–2017 University Health Network. All rights reserved.