Sun Adapter for TCP/IP HL7

com.stc.connector.hl7.framework.structure.msg
Class GenericMessageImpl

java.lang.Object
  extended by com.stc.connector.hl7.framework.structure.component.GenericComponentImpl
      extended by com.stc.connector.hl7.framework.structure.msg.GenericMessageImpl
All Implemented Interfaces:
Component, Message
Direct Known Subclasses:
ACK

public class GenericMessageImpl
extends GenericComponentImpl
implements Message

This class represents a generic implementation of HL7 message.

Version:
cvs revision: $Revision: 1.13 $ Last Modified: $Date: 2008/04/24 14:30:39 $
Author:
Harry Liu

Field Summary
static java.lang.String version
           
 
Fields inherited from interface com.stc.connector.hl7.framework.structure.msg.Message
DEFAULT_SEGMENT_TERMINATOR_CHAR, DEFAULT_SEGMENT_TERMINATOR_STRING
 
Constructor Summary
GenericMessageImpl()
          Constructor for GenericMessageImpl.
GenericMessageImpl(java.lang.String name, Segment[] segments)
          Constructor for GenericMessageImpl.
GenericMessageImpl(java.lang.String name, java.lang.String content)
          Constructor for GenericMessageImpl.
 
Method Summary
 java.lang.String getComponentSeparator()
          Returns the componentSeparator.
 java.lang.String getEncodingCharacters()
           
 java.lang.String getEscapeCharacter()
          Returns the escapeCharacter.
 java.lang.String getFieldSeparator()
          Returns the fieldSeparator.
 MSH getMSH()
          Returns the MSH (Message Header Segment) of this message.
 java.lang.String getRepetitionSeparator()
          Returns the repetitionSeparator.
 Segment[] getSegments()
          Method getSegments.
 java.lang.String getSubcomponentSeparator()
          Returns the subcomponentSeparator.
 java.lang.String getVersionNumber()
          Method getVersionNumber.
 boolean isParseAllSegments()
           
 void marshal()
          Method marshal.
 void setParseAllSegments(boolean b)
           
protected  void setSegments(Segment[] segments)
          Sets the segments.
 java.lang.String toXMLString(ComponentSpec componentSpec)
          Method toXMLString.
 void unmarshal()
          Method unmarshal.
 void validate(ComponentSpec componentSpec)
          Method validate.
 
Methods inherited from class com.stc.connector.hl7.framework.structure.component.GenericComponentImpl
getContent, getMessage, getName, getStatus, setContent, setMessage, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.stc.connector.hl7.framework.structure.component.Component
getContent, getMessage, getName, setContent, setName
 

Field Detail

version

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

GenericMessageImpl

public GenericMessageImpl()
                   throws HL7ApplicationException
Constructor for GenericMessageImpl.

Throws:
HL7ApplicationException

GenericMessageImpl

public GenericMessageImpl(java.lang.String name,
                          java.lang.String content)
                   throws HL7ApplicationException
Constructor for GenericMessageImpl.

Parameters:
name -
content -
Throws:
HL7ApplicationException

GenericMessageImpl

public GenericMessageImpl(java.lang.String name,
                          Segment[] segments)
                   throws HL7ApplicationException
Constructor for GenericMessageImpl.

Parameters:
name -
segments -
Throws:
HL7ApplicationException
Method Detail

marshal

public void marshal()
             throws HL7ApplicationException
Description copied from interface: Component
Method marshal. Marshal the corresponding structure into content. Once the structure is modified, to refresh the content against the modified structure, this method should be called.

Specified by:
marshal in interface Component
Overrides:
marshal in class GenericComponentImpl
Throws:
HL7ApplicationException
See Also:
Component.marshal()

unmarshal

public void unmarshal()
               throws HL7ApplicationException
Description copied from interface: Component
Method unmarshal. Un-Marshal the content into corresponding structure. Once the content is modified, to refresh the corresponding structure against the modified content, this method should be called.

Specified by:
unmarshal in interface Component
Overrides:
unmarshal in class GenericComponentImpl
Throws:
HL7ApplicationException
See Also:
Component.unmarshal()

getMSH

public MSH getMSH()
Description copied from interface: Message
Returns the MSH (Message Header Segment) of this message.

Specified by:
getMSH in interface Message
Returns:
MSH
See Also:
Message.getMSH()

getComponentSeparator

public java.lang.String getComponentSeparator()
Returns the componentSeparator.

Specified by:
getComponentSeparator in interface Message
Returns:
String

getEscapeCharacter

public java.lang.String getEscapeCharacter()
Returns the escapeCharacter.

Specified by:
getEscapeCharacter in interface Message
Returns:
String

getFieldSeparator

public java.lang.String getFieldSeparator()
Returns the fieldSeparator.

Specified by:
getFieldSeparator in interface Message
Returns:
String

getRepetitionSeparator

public java.lang.String getRepetitionSeparator()
Returns the repetitionSeparator.

Specified by:
getRepetitionSeparator in interface Message
Returns:
String

getSubcomponentSeparator

public java.lang.String getSubcomponentSeparator()
Returns the subcomponentSeparator.

Specified by:
getSubcomponentSeparator in interface Message
Returns:
String

getVersionNumber

public java.lang.String getVersionNumber()
Description copied from interface: Message
Method getVersionNumber.

Specified by:
getVersionNumber in interface Message
Returns:
String
See Also:
Message.getVersionNumber()

getSegments

public Segment[] getSegments()
Description copied from interface: Message
Method getSegments.

Specified by:
getSegments in interface Message
Returns:
Segment[]
See Also:
Message.getSegments()

setSegments

protected void setSegments(Segment[] segments)
                    throws HL7ApplicationException
Sets the segments.

Parameters:
segments - The segments to set
Throws:
HL7ApplicationException

validate

public void validate(ComponentSpec componentSpec)
              throws HL7ApplicationException
Description copied from interface: Component
Method validate. This method is supposed to be called after "new xxxStructureImpl()", that is, "new GenericComponentImpl(...)", "new GenericDataTypeImpl(...)", "new GenericFieldImpl(...)", "new GenericSegmentImpl(...)", "new GenericMessageImpl(...)", "new MSH(...)", "new MSA(...)", "new ERR(...)", "new ACK(...)".

Specified by:
validate in interface Component
Overrides:
validate in class GenericComponentImpl
Throws:
HL7ApplicationException
See Also:
Component.validate(ComponentSpec)

toXMLString

public java.lang.String toXMLString(ComponentSpec componentSpec)
                             throws HL7ApplicationException
Description copied from interface: Component
Method toXMLString.

Specified by:
toXMLString in interface Component
Overrides:
toXMLString in class GenericComponentImpl
Throws:
HL7ApplicationException
See Also:
Component.toXMLString(com.stc.connector.hl7.framework.spec.component.ComponentSpec)

getEncodingCharacters

public java.lang.String getEncodingCharacters()
Returns:

isParseAllSegments

public boolean isParseAllSegments()
Returns:

setParseAllSegments

public void setParseAllSegments(boolean b)
Parameters:
b -

Sun Adapter for TCP/IP HL7