com.americancoders.edi
Class TransactionSet

java.lang.Object
  |
  +--com.americancoders.edi.TransactionSet

public class TransactionSet
extends java.lang.Object
implements java.io.Externalizable

class for all EDI Transaction Sets

OBOE - Open Business Objects for EDI
An EDI and XML Translator Written In Java
Copyright 1998-2000 - American Coders, LTD - Raleigh NC USA
All rights reserved
American Coders, Ltd
P. O. Box 97462
Raleigh, NC 27624 USA
1-919-846-2014
http://www.americancoders.com

Version:
1.4.1
Author:
Joe McVerry, American Coders Ltd.
See Also:
Serialized Form

Field Summary
static java.lang.String EDIFACT_FIELD_DELIMITER
           
static int EDIFACT_FORMAT
           
static java.lang.String EDIFACT_GROUP_DELIMITER
           
static java.lang.String EDIFACT_SEGMENT_DELIMITER
           
static java.lang.String X12_FIELD_DELIMITER
           
static int X12_FORMAT
           
static java.lang.String X12_GROUP_DELIMITER
           
static java.lang.String X12_SEGMENT_DELIMITER
           
static int XML_FORMAT
           
 
Constructor Summary
TransactionSet()
          constructs a Transaction Set, used by Externalize function
TransactionSet(java.lang.String inId, java.lang.String inName, java.lang.String inRevision, java.lang.String inFunctionalGroup, java.lang.String inShortDescription)
          constructs a Transaction Set
sets xml tag field to value in short description
TransactionSet(java.lang.String inId, java.lang.String inName, java.lang.String inRevision, java.lang.String inFunctionalGroup, java.lang.String inShortDescription, java.lang.String inXMLTag)
          constructs a Transaction Set
 
Method Summary
 java.lang.String get()
          returns all the data associated with the Transaction Set of type Purchase_Order
 Table getDetailTable()
          returns detail table for the Transaction Set
 java.lang.String getFormattedText(int formatType)
          returns a formatted string of the transaction set
 java.lang.String getFunctionalGroup()
          return Functional Group for the Transaction Set
 Table getHeaderTable()
          returns header table for the Transaction Set
 java.lang.String getID()
          returns id for the Transaction Set
 java.lang.String getName()
          returns name for the Transaction Set
 java.lang.String getRevision()
          returns revision value for the Transaction Set
 int getSegmentCount()
          returns the number of segments
 java.lang.String getShortDescription()
          returns the Short Description for the Transaction Set
 Table getSummaryTable()
          returns summary table for the Transaction Set
 java.lang.String getXMLTag()
          returns the xml tag field
 void parse(ITokenizer TransactionTokenizedString)
          parses an EDI Document from tokenized string
 void parse(org.w3c.dom.Node node)
          parses a XML EDI Document from a DOM node.
 void readExternal(java.io.ObjectInput in)
          used by externalize methods
 void setDetailTable(Table inTable)
          sets detail table for the Transaction Set
 void setFunctionalGroup(java.lang.String inFunctionalGroup)
          sets Function Group for the Transaction Set
 void setHeaderTable(Table inTable)
          sets header table for the Transaction Set
 void setID(java.lang.String inId)
          sets id for the Transaction Set
 void setName(java.lang.String inName)
          sets name for the Transaction Set
 void setRevision(java.lang.String inRevision)
          sets Revision for the Transaction Set
 void setShortDescription(java.lang.String inDesc)
          sets Short Description for the Transaction Set
 void setSummaryTable(Table inTable)
          sets summary table for the Transaction Set
 void setXMLTag(java.lang.String inXMLTag)
          sets the xml tag field
 void validate()
          validates segment syntax for correct DataElements
 void writeExternal(java.io.ObjectOutput out)
          used by externalize methods
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_FORMAT

public static final int XML_FORMAT

X12_FORMAT

public static final int X12_FORMAT

EDIFACT_FORMAT

public static final int EDIFACT_FORMAT

X12_SEGMENT_DELIMITER

public static final java.lang.String X12_SEGMENT_DELIMITER

X12_FIELD_DELIMITER

public static final java.lang.String X12_FIELD_DELIMITER

X12_GROUP_DELIMITER

public static final java.lang.String X12_GROUP_DELIMITER

EDIFACT_SEGMENT_DELIMITER

public static final java.lang.String EDIFACT_SEGMENT_DELIMITER

EDIFACT_FIELD_DELIMITER

public static final java.lang.String EDIFACT_FIELD_DELIMITER

EDIFACT_GROUP_DELIMITER

public static final java.lang.String EDIFACT_GROUP_DELIMITER
Constructor Detail

TransactionSet

public TransactionSet()
constructs a Transaction Set, used by Externalize function

TransactionSet

public TransactionSet(java.lang.String inId,
                      java.lang.String inName,
                      java.lang.String inRevision,
                      java.lang.String inFunctionalGroup,
                      java.lang.String inShortDescription)
constructs a Transaction Set
sets xml tag field to value in short description
Parameters:
String - id
String - revision number
String - Functional Group
String - short description

TransactionSet

public TransactionSet(java.lang.String inId,
                      java.lang.String inName,
                      java.lang.String inRevision,
                      java.lang.String inFunctionalGroup,
                      java.lang.String inShortDescription,
                      java.lang.String inXMLTag)
constructs a Transaction Set
Parameters:
String - id
String - revision number
String - Functional Group
String - short description
String - XML Tag
Method Detail

parse

public void parse(ITokenizer TransactionTokenizedString)
           throws java.lang.Exception
parses an EDI Document from tokenized string
Parameters:
TransactionTokenizedString - input string containing all of the transaction data pretokened by EDIObjects.Tokenizer
Throws:
java.lang.Exception - thrown when the transaction id string is incorrect
java.lang.Exception - thrown when an unknown segment id string is foundi

parse

public void parse(org.w3c.dom.Node node)
           throws java.lang.Exception
parses a XML EDI Document from a DOM node.
Parameters:
node - XML Node element
Throws:
java.lang.Exception - thrown when the transaction id string is incorrect
java.lang.Exception - thrown when an unknown segment id string is foundi

setID

public void setID(java.lang.String inId)
sets id for the Transaction Set
Parameters:
String - id String

setName

public void setName(java.lang.String inName)
sets name for the Transaction Set
Parameters:
String - name String

setRevision

public void setRevision(java.lang.String inRevision)
sets Revision for the Transaction Set
Parameters:
String - Revision String

setFunctionalGroup

public void setFunctionalGroup(java.lang.String inFunctionalGroup)
sets Function Group for the Transaction Set
Parameters:
String - Function Group String

setShortDescription

public void setShortDescription(java.lang.String inDesc)
sets Short Description for the Transaction Set
Parameters:
String - Description String

setHeaderTable

public void setHeaderTable(Table inTable)
sets header table for the Transaction Set
Parameters:
Table - header table

setDetailTable

public void setDetailTable(Table inTable)
sets detail table for the Transaction Set
Parameters:
Table - detail table

setSummaryTable

public void setSummaryTable(Table inTable)
sets summary table for the Transaction Set
Parameters:
Table - summary table

getID

public java.lang.String getID()
returns id for the Transaction Set
Returns:
String

getName

public java.lang.String getName()
returns name for the Transaction Set
Returns:
String

getRevision

public java.lang.String getRevision()
returns revision value for the Transaction Set
Returns:
String

getFunctionalGroup

public java.lang.String getFunctionalGroup()
return Functional Group for the Transaction Set
Returns:
String

getShortDescription

public java.lang.String getShortDescription()
returns the Short Description for the Transaction Set
Returns:
String

getHeaderTable

public Table getHeaderTable()
returns header table for the Transaction Set
Returns:
Table

getDetailTable

public Table getDetailTable()
returns detail table for the Transaction Set
Returns:
Table

getSummaryTable

public Table getSummaryTable()
returns summary table for the Transaction Set
Returns:
Table

get

public java.lang.String get()
                     throws java.lang.Exception
returns all the data associated with the Transaction Set of type Purchase_Order
Returns:
String for all segments within the Transaction Set
Throws:
java.lang.Exception - - subsegments will throw

setXMLTag

public void setXMLTag(java.lang.String inXMLTag)
sets the xml tag field
Parameters:
String - tag value

getXMLTag

public java.lang.String getXMLTag()
returns the xml tag field
Returns:
String tag value

validate

public void validate()
              throws java.lang.Exception
validates segment syntax for correct DataElements
Throws:
java.lang.Exception - indicates why segment is invalid

getSegmentCount

public int getSegmentCount()
returns the number of segments
Returns:
int count

getFormattedText

public java.lang.String getFormattedText(int formatType)
returns a formatted string of the transaction set
Parameters:
int - type: TransactionSet.XML_FORMAT, TransactionSet.X12_FORMAT, TransactionSet.EDIFACT_FORMAT:
Returns:
String formattedOutput

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
used by externalize methods
Specified by:
readExternal in interface java.io.Externalizable
Parameters:
ObjectInput - object input stream
Throws:
java.io.IOException - - most likely class changed since written
java.lang.ClassNotFoundException - - only when dummy constructro not found

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
used by externalize methods
Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
ObjectInput - object input stream
Throws:
java.io.IOException -