Package org.apache.camel.component.hl7
Enum Class HL7Charset
- All Implemented Interfaces:
Serializable,Comparable<HL7Charset>,Constable
This enumerates the defined charsets for HL7 as defined in Table 0211, mapping them to the Java charset names and
back
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetCharsetName(byte[] bytes, String guessedCharsetName) Returns the charset to be used for unmarshalling HL7 messages.static StringgetCharsetName(ca.uhn.hl7v2.model.Message message, org.apache.camel.Exchange exchange) Returns the charset to be used for marshalling HL7 messages.static HL7CharsetReturns the HL7Charset that matches the parameterstatic HL7CharsetReturns the enum constant of this class with the specified name.static HL7Charset[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ISO_8859_1
-
ISO_8859_2
-
ISO_8859_3
-
ISO_8859_4
-
ISO_8859_5
-
ISO_8859_6
-
ISO_8859_7
-
ISO_8859_8
-
ISO_8859_9
-
ASCII
-
BIG_5
-
CNS
-
GB_1830_2000
-
ISO_IR14
-
ISO_IR159
-
ISO_IR87
-
KS_X_1001
-
UNICODE
-
UTF_16
-
UTF_32
-
UTF_8
-
-
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
-
getHL7CharsetName
-
getJavaCharsetName
-
getHL7Charset
Returns the HL7Charset that matches the parameter- Parameters:
s- charset string- Returns:
- HL7Charset enum
-
getCharsetName
public static String getCharsetName(ca.uhn.hl7v2.model.Message message, org.apache.camel.Exchange exchange) throws ca.uhn.hl7v2.HL7Exception Returns the charset to be used for marshalling HL7 messages. If MSH-18 is empty, the charset configured in Camel's charset properties/headers is returned.- Parameters:
message- HL7 messageexchange- Exchange- Returns:
- Java charset name
- Throws:
ca.uhn.hl7v2.HL7Exception
-
getCharsetName
public static String getCharsetName(byte[] bytes, String guessedCharsetName) throws UnsupportedEncodingException, ca.uhn.hl7v2.HL7Exception Returns the charset to be used for unmarshalling HL7 messages. If MSH-18 is empty, the temporary charset name is returned.- Parameters:
bytes- HL7 message as byte arrayguessedCharsetName- the temporary charset guessed to be able to read MSH-18- Returns:
- Java charset name
- Throws:
UnsupportedEncodingExceptionca.uhn.hl7v2.HL7Exception- See Also:
-