Package ca.uhn.fhir.rest.api
Enum EncodingEnum
- All Implemented Interfaces:
Serializable
,Comparable<EncodingEnum>
-
Enum Constant Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic EncodingEnum
detectEncoding
(String theBody) static EncodingEnum
detectEncodingNoDefault
(String theBody) static EncodingEnum
forContentType
(String theContentType) Returns the encoding for a given content type, ornull
if no encoding is found.static EncodingEnum
forContentTypeStrict
(String theContentType) Returns the encoding for a given content type, ornull
if no encoding is found.Returnsxml
orjson
as used on the_format
search parameterWill return application/xml+fhir styleWill return application/fhir+xml stylestatic boolean
Is the given type a FHIR legacy (pre-DSTU3) content type?abstract IParser
newParser
(FhirContext theContext) static EncodingEnum
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.
-
Enum Constant Details
-
JSON
-
XML
-
RDF
-
NDJSON
-
-
Field Details
-
JSON_PLAIN_STRING
"json"- See Also:
-
RDF_PLAIN_STRING
"rdf"- See Also:
-
XML_PLAIN_STRING
"xml"- See Also:
-
NDJSON_PLAIN_STRING
"ndjson"- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getFormatContentType
Returnsxml
orjson
as used on the_format
search parameter -
getResourceContentType
Will return application/xml+fhir style -
getResourceContentTypeNonLegacy
Will return application/fhir+xml style -
newParser
-
detectEncoding
-
detectEncodingNoDefault
-
forContentType
Returns the encoding for a given content type, ornull
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. Also, spaces are treated as a plus (i.e. "application/fhir json" will be treated as "application/fhir+json" in order to account for unescaped spaces in URL parameters) -
forContentTypeStrict
Returns the encoding for a given content type, ornull
if no encoding is found.This method is NOT lenient! Things like "application/xml" will return
null
- See Also:
-
isLegacy
Is the given type a FHIR legacy (pre-DSTU3) content type?
-