Sun Adapter for TCP/IP HL7

com.stc.connector.message.common
Class TextMsg

java.lang.Object
  extended by com.stc.connector.message.common.TextMsg
All Implemented Interfaces:
AbstractMsg

public class TextMsg
extends java.lang.Object
implements AbstractMsg

This message represents a generic text message implementation.

Version:
cvs revision: $Revision: 1.6 $ Last Modified: $Date: 2008/02/29 08:59:23 $
Author:
Harry Liu

Field Summary
static java.lang.String version
           
 
Constructor Summary
TextMsg(java.lang.String text)
          Constructor.
TextMsg(java.lang.String text, java.lang.String encoding)
          Constructor
 
Method Summary
 byte[] getBytes()
          Returns a byte array.
static java.lang.String getDefaultEncoding()
          Returns the defaultEncoding.
 java.lang.String getEncoding()
          Returns the encoding.
 java.lang.String getText()
          Returns the text string.
static void setDefaultEncoding(java.lang.String defaultEncoding)
          Sets the defaultEncoding.
 void setEncoding(java.lang.String encoding)
          Sets the encoding.
 void setText(java.lang.String text)
          Sets the text string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static final java.lang.String version
See Also:
Constant Field Values
Constructor Detail

TextMsg

public TextMsg(java.lang.String text,
               java.lang.String encoding)
Constructor

Parameters:
text - The text string to construct the message.
encoding - The encoding code.

TextMsg

public TextMsg(java.lang.String text)
Constructor. Uses "ISO-8859-1" as default encoding. You can change the default encoding through method setDefaultEncoding(String defaultEncoding)

Parameters:
text - The text string to construct the message.
Method Detail

getDefaultEncoding

public static java.lang.String getDefaultEncoding()
Returns the defaultEncoding.

Returns:
The default encoding

setDefaultEncoding

public static void setDefaultEncoding(java.lang.String defaultEncoding)
Sets the defaultEncoding.

Parameters:
defaultEncoding - The defaultEncoding to set

getText

public java.lang.String getText()
Returns the text string.

Returns:
The text string

setText

public void setText(java.lang.String text)
Sets the text string.

Parameters:
text - The text string to set

getEncoding

public java.lang.String getEncoding()
Returns the encoding.

Returns:
The encoding

setEncoding

public void setEncoding(java.lang.String encoding)
Sets the encoding.

Parameters:
encoding - The encoding to set

getBytes

public byte[] getBytes()
                throws java.io.IOException
Description copied from interface: AbstractMsg
Returns a byte array. This is the method that all kinds of messages need to implement.

Specified by:
getBytes in interface AbstractMsg
Returns:
A byte array
Throws:
java.io.IOException - on error
See Also:
AbstractMsg.getBytes()

Sun Adapter for TCP/IP HL7