Enum EncodingEnum

    • Method Detail

      • values

        public static EncodingEnum[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (EncodingEnum c : EncodingEnum.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static EncodingEnum valueOf​(String name)
        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 name
        NullPointerException - if the argument is null
      • getFormatContentType

        public String getFormatContentType()
        Returns xml or json as used on the _format search parameter
      • getResourceContentType

        public String getResourceContentType()
        Will return application/xml+fhir style
      • getResourceContentTypeNonLegacy

        public String getResourceContentTypeNonLegacy()
        Will return application/fhir+xml style
      • detectEncodingNoDefault

        public static EncodingEnum detectEncodingNoDefault​(String theBody)
      • forContentType

        public static EncodingEnum forContentType​(String theContentType)
        Returns the encoding for a given content type, or 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. 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

        public static EncodingEnum forContentTypeStrict​(String theContentType)
        Returns the encoding for a given content type, or null if no encoding is found.

        This method is NOT lenient! Things like "application/xml" will return null

        See Also:
        forContentType(String)
      • isLegacy

        public static boolean isLegacy​(String theContentType)
        Is the given type a FHIR legacy (pre-DSTU3) content type?