ca.uhn.hl7v2.parser
Class EncodingCharacters

java.lang.Object
  extended by ca.uhn.hl7v2.parser.EncodingCharacters
All Implemented Interfaces:
java.lang.Cloneable

public class EncodingCharacters
extends java.lang.Object
implements java.lang.Cloneable

Represents the set of special characters used to encode traditionally encoded HL7 messages.

Author:
Bryan Tripp (bryan_tripp@sourceforge.net)

Constructor Summary
EncodingCharacters(char fieldSeparator, char componentSeparator, char repetitionSeparator, char escapeCharacter, char subcomponentSeparator)
           
EncodingCharacters(char fieldSeparator, java.lang.String encodingCharacters)
          Creates new EncodingCharacters object with the given character values.
EncodingCharacters(EncodingCharacters other)
          copies contents of "other"
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object o)
           
 char getComponentSeparator()
          Returns the component separator.
 char getEscapeCharacter()
          Returns the escape character.
 char getFieldSeparator()
          Returns the field separator.
static EncodingCharacters getInstance(Message message)
          Returns an instance using the MSH-1 and MSH-2 values of the given message
 char getRepetitionSeparator()
          Returns the repetition separator.
 char getSubcomponentSeparator()
          Returns the subcomponent separator.
 int hashCode()
           
 void setComponentSeparator(char newComponentSep)
           
 void setEscapeCharacter(char newEscapeChar)
           
 void setFieldSeparator(char newFieldSep)
           
 void setRepetitionSeparator(char newRepetitionSep)
           
 void setSubcomponentSeparator(char newSubcomponentSep)
           
 java.lang.String toString()
          Returns the encoding characters (not including field separator) as a string.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EncodingCharacters

public EncodingCharacters(char fieldSeparator,
                          java.lang.String encodingCharacters)
Creates new EncodingCharacters object with the given character values. If the encodingCharacters argument is null, the default values are used.

Parameters:
encodingCharacters - consists of the characters that appear in MSH-2 (see section 2.8 of the HL7 spec). The characters are Component Separator, Repetition Separator, Escape Character, and Subcomponent Separator (in that order).

EncodingCharacters

public EncodingCharacters(char fieldSeparator,
                          char componentSeparator,
                          char repetitionSeparator,
                          char escapeCharacter,
                          char subcomponentSeparator)

EncodingCharacters

public EncodingCharacters(EncodingCharacters other)
copies contents of "other"

Method Detail

getInstance

public static EncodingCharacters getInstance(Message message)
                                      throws HL7Exception
Returns an instance using the MSH-1 and MSH-2 values of the given message

Throws:
HL7Exception - If either MSH-1 or MSH-2 are not populated
Since:
1.0

getFieldSeparator

public char getFieldSeparator()
Returns the field separator.


getComponentSeparator

public char getComponentSeparator()
Returns the component separator.


getRepetitionSeparator

public char getRepetitionSeparator()
Returns the repetition separator.


getEscapeCharacter

public char getEscapeCharacter()
Returns the escape character.


getSubcomponentSeparator

public char getSubcomponentSeparator()
Returns the subcomponent separator.


toString

public java.lang.String toString()
Returns the encoding characters (not including field separator) as a string.

Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

setFieldSeparator

public void setFieldSeparator(char newFieldSep)

setComponentSeparator

public void setComponentSeparator(char newComponentSep)

setRepetitionSeparator

public void setRepetitionSeparator(char newRepetitionSep)

setEscapeCharacter

public void setEscapeCharacter(char newEscapeChar)

setSubcomponentSeparator

public void setSubcomponentSeparator(char newSubcomponentSep)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()


Copyright © 2001-2011 University Health Network. All Rights Reserved.