Package de.gematik.bbriccs.fhir
Enum Class EncodingType
- All Implemented Interfaces:
Serializable,Comparable<EncodingType>,Constable
The only Encodings we support for FHIR representation
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescription<T> Tca.uhn.fhir.parser.IParserchooseAppropriateParser(ca.uhn.fhir.parser.IParser xml, ca.uhn.fhir.parser.IParser json) Choose one of the two given parsers as a function of the actualEncodingTypestatic ca.uhn.fhir.parser.IParserchooseAppropriateParser(String encoding, ca.uhn.fhir.parser.IParser xml, ca.uhn.fhir.parser.IParser json) Choose one of the two given parsers as a function of the given encoding as a Stringca.uhn.fhir.parser.IParserchooseAppropriateParser(Supplier<ca.uhn.fhir.parser.IParser> xml, Supplier<ca.uhn.fhir.parser.IParser> json) static EncodingTypefromString(String value) static EncodingTypeguessFromContent(String content) Try to guess the encoding from the content itself.static EncodingTypeReturns the enum constant of this class with the specified name.static EncodingType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
XML
-
JSON
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
fromString
-
flipEncoding
-
toFileExtension
-
chooseAppropriateParser
public static ca.uhn.fhir.parser.IParser chooseAppropriateParser(String encoding, ca.uhn.fhir.parser.IParser xml, ca.uhn.fhir.parser.IParser json) Choose one of the two given parsers as a function of the given encoding as a String- Parameters:
encoding- defines which encoding to choose e.g. by a file extension like .xml or simply jsonxml- the XML Parserjson- the JSON Parser- Returns:
- either the XML or the JSON parser dependent of the given encoding
-
chooseAppropriateParser
public ca.uhn.fhir.parser.IParser chooseAppropriateParser(ca.uhn.fhir.parser.IParser xml, ca.uhn.fhir.parser.IParser json) Choose one of the two given parsers as a function of the actualEncodingType- Parameters:
xml- the XML Parserjson- the JSON Parser- Returns:
- either the XML or the JSON parser depending on the actual
EncodingType
-
chooseAppropriateParser
-
choose
-
guessFromContent
Try to guess the encoding from the content itself. Use with caution as might be very unreliable in many cases!- Parameters:
content- the content which needs to be parsed- Returns:
- XML if the content is empty or starts with the char < (indicating XML) and JSON otherwise
-