Package org.apache.camel.component.hl7
Enum HL7Charset
- java.lang.Object
-
- java.lang.Enum<HL7Charset>
-
- org.apache.camel.component.hl7.HL7Charset
-
- All Implemented Interfaces:
Serializable
,Comparable<HL7Charset>
public enum HL7Charset extends Enum<HL7Charset>
This enumerates the defined charsets for HL7 as defined in Table 0211, mapping them to the Java charset names and back
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ASCII
BIG_5
CNS
GB_1830_2000
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
ISO_IR14
ISO_IR159
ISO_IR87
KS_X_1001
UNICODE
UTF_16
UTF_32
UTF_8
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
getCharsetName(byte[] bytes, String guessedCharsetName)
Returns the charset to be used for unmarshalling HL7 messages.static String
getCharsetName(ca.uhn.hl7v2.model.Message message, org.apache.camel.Exchange exchange)
Returns the charset to be used for marshalling HL7 messages.static HL7Charset
getHL7Charset(String s)
Returns the HL7Charset that matches the parameterString
getHL7CharsetName()
String
getJavaCharsetName()
static HL7Charset
valueOf(String name)
Returns the enum constant of this type with the specified name.static HL7Charset[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ISO_8859_1
public static final HL7Charset ISO_8859_1
-
ISO_8859_2
public static final HL7Charset ISO_8859_2
-
ISO_8859_3
public static final HL7Charset ISO_8859_3
-
ISO_8859_4
public static final HL7Charset ISO_8859_4
-
ISO_8859_5
public static final HL7Charset ISO_8859_5
-
ISO_8859_6
public static final HL7Charset ISO_8859_6
-
ISO_8859_7
public static final HL7Charset ISO_8859_7
-
ISO_8859_8
public static final HL7Charset ISO_8859_8
-
ISO_8859_9
public static final HL7Charset ISO_8859_9
-
ASCII
public static final HL7Charset ASCII
-
BIG_5
public static final HL7Charset BIG_5
-
CNS
public static final HL7Charset CNS
-
GB_1830_2000
public static final HL7Charset GB_1830_2000
-
ISO_IR14
public static final HL7Charset ISO_IR14
-
ISO_IR159
public static final HL7Charset ISO_IR159
-
ISO_IR87
public static final HL7Charset ISO_IR87
-
KS_X_1001
public static final HL7Charset KS_X_1001
-
UNICODE
public static final HL7Charset UNICODE
-
UTF_16
public static final HL7Charset UTF_16
-
UTF_32
public static final HL7Charset UTF_32
-
UTF_8
public static final HL7Charset UTF_8
-
-
Method Detail
-
values
public static HL7Charset[] 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 (HL7Charset c : HL7Charset.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static HL7Charset 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 nameNullPointerException
- if the argument is null
-
getHL7CharsetName
public String getHL7CharsetName()
-
getJavaCharsetName
public String getJavaCharsetName()
-
getHL7Charset
public static HL7Charset getHL7Charset(String s)
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:
UnsupportedEncodingException
ca.uhn.hl7v2.HL7Exception
- See Also:
HL7DataFormat.guessCharsetName(byte[], org.apache.camel.Exchange)
-
-