Open Business Objects for EDI
v3.6.0

com.americancoders.edi
Class TransactionSet

java.lang.Object
  |
  +--com.americancoders.edi.SegmentContainer
        |
        +--com.americancoders.edi.TransactionSet
All Implemented Interfaces:
IContainedObject, IIdentifier, ISegmentContainer

public class TransactionSet
extends SegmentContainer
implements IContainedObject

class for all EDI Transaction Sets

OBOE - Open Business Objects for EDI

Part of the OBOE Basic Extended Package
An EDI and XML Translator Written In Java
Copyright 1998-2009 - 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:
3.6.0
Author:
Joe McVerry - American Coders, Ltd.

Field Summary
protected  com.americancoders.edi.IContainedObject parent
           
 
Fields inherited from class com.americancoders.edi.SegmentContainer
container, dupSegment, myTemplateContainer
 
Constructor Summary
TransactionSet(com.americancoders.edi.TemplateTransactionSet inTemplateTransactionSet, com.americancoders.edi.IContainedObject inParent)
          creates a transactionset object from a template
 
Method Summary
 boolean continueParse(com.americancoders.edi.SegmentContainer inContainer, com.americancoders.edi.ITokenizer TransactionTokenizedString)
          continues to parse an EDI Document after an error.
 com.americancoders.edi.Table getDetailTable()
          returns detail table for the Transaction Set
 int getFormat()
          returns the Transaction Set format
 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
 com.americancoders.edi.Table getHeaderTable()
          returns header table for the Transaction Set
 java.lang.String getID()
          returns the Transaction Set id
 java.lang.String getName()
          returns name for the Transaction Set
 com.americancoders.edi.IContainedObject getParent()
          gets parent attribute
 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
 com.americancoders.edi.Table getSummaryTable()
          returns summary table for the Transaction Set
 com.americancoders.edi.TemplateSegmentContainer getTemplateSegmentContainer()
          return segment container template
 com.americancoders.edi.TemplateTransactionSet getTemplateTransactionSet()
          return the transactionset's template
 java.lang.String getXMLTag()
          returns the xml tag field
 boolean parse(com.americancoders.edi.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 parse(java.io.PushbackInputStream pis)
          parses a FixedLength EDI Document from a Data Input Stream.
 void setDetailTable(com.americancoders.edi.Table inTable)
          sets detail table for the Transaction Set
 void setFormat(int inFormat)
          sets format for the Transaction Set
XML_FORMAT = 1;
X12_FORMAT = 2;
EDIFACT_FORMAT = 3;
VALID_XML_FORMAT = 4;
 void setFunctionalGroup(java.lang.String inFunctionalGroup)
          sets Function Group for the Transaction Set
 void setHeaderTable(com.americancoders.edi.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 setParent(com.americancoders.edi.IContainedObject inParent)
          sets parent attribute
 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(com.americancoders.edi.Table inTable)
          sets summary table for the Transaction Set
 void setTrailerFields()
          sets the SE (for X12) or UNT (for EDIFact) control number and count fields
 void setXMLTag(java.lang.String inXMLTag)
          sets the xml tag field
 int trim()
          trims out unused segments and returns number of used segments
 void useDefault()
          sets the default value for the data elements
does nothing in Basic Edition, just a stub
will call tables useDefault methods, tables will create mandatory subsegments
 void validate()
          validates segment syntax for correct DataElements
 void validate(com.americancoders.edi.DocumentErrors inDErr)
          validates segment syntax for correct DataElements
doesn't throw exception, places error text in DocumentErrors object
 void writeFormattedText(java.io.Writer inWriter, int formatType)
          like getFormattedText; writes to a Writer object instead of building a string.
 
Methods inherited from class com.americancoders.edi.SegmentContainer
addSegment, addSegment, addSegment, addSegmentToVector, createSegment, createSegment, createSegmentByIDAndName, defineContainer, equivalentSegments, getContainerSize, getSegment, getSegment, getSegment, getSegment, getSegment, getSegment, getSegmentByDataElementValue, getSegmentCount, getSegmentCount, isNull, isSegment, isSegment, isVector, removeSegment, removeSegment, removeSegment, removeSegment, resetToFirstEquivalentSegment, setSegmentAt, setSegmentAt, whyNotUsed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected com.americancoders.edi.IContainedObject parent
Constructor Detail

TransactionSet

public TransactionSet(com.americancoders.edi.TemplateTransactionSet inTemplateTransactionSet,
                      com.americancoders.edi.IContainedObject inParent)
creates a transactionset object from a template

Parameters:
inTemplateTransactionSet -
inParent - owning Object
Method Detail

parse

public boolean parse(com.americancoders.edi.ITokenizer TransactionTokenizedString)
              throws OBOEException
parses an EDI Document from tokenized string

Overrides:
parse in class SegmentContainer
Parameters:
TransactionTokenizedString - input string containing all of the transaction data pretokened by OBOE.Tokenizer
Returns:
boolean - true if tts was used
Throws:
OBOEException - thrown when the transaction id string is incorrect
OBOEException - thrown when an unknown segment id string is found

continueParse

public boolean continueParse(com.americancoders.edi.SegmentContainer inContainer,
                             com.americancoders.edi.ITokenizer TransactionTokenizedString)
                      throws OBOEException
continues to parse an EDI Document after an error. Searches through the containers until last one container to make a good request is found. So the process can continue on.

Parameters:
inContainer - last container used.
TransactionTokenizedString - input string containing all of the transaction data pretokened by OBOE.Tokenizer
Returns:
boolean - reparse started
Throws:
OBOEException - thrown when the transaction id string is incorrect
OBOEException - thrown when an unknown segment id string is found

parse

public void parse(org.w3c.dom.Node node)
           throws OBOEException
parses a XML EDI Document from a DOM node.

Parameters:
node - XML Node element
Throws:
OBOEException - thrown when the transaction id string is incorrect
OBOEException - thrown when an unknown segment id string is foundi

parse

public void parse(java.io.PushbackInputStream pis)
           throws OBOEException,
                  java.io.IOException
parses a FixedLength EDI Document from a Data Input Stream.

Parameters:
pis - PushbackInputStream
Throws:
OBOEException - thrown when the transaction id string is incorrect
OBOEException - thrown when an unknown segment id string is foundi
java.io.IOException

setFormat

public void setFormat(int inFormat)
sets format for the Transaction Set
XML_FORMAT = 1;
X12_FORMAT = 2;
EDIFACT_FORMAT = 3;
VALID_XML_FORMAT = 4;

Parameters:
inFormat - int format

setID

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

Parameters:
inId - String transation set id

setName

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

Parameters:
inName - String transaction set name

setRevision

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

Parameters:
inRevision - String revision or version

setFunctionalGroup

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

Parameters:
inFunctionalGroup - String functional group

setShortDescription

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

Parameters:
inDesc - String description

setHeaderTable

public void setHeaderTable(com.americancoders.edi.Table inTable)
sets header table for the Transaction Set

Parameters:
inTable - Table

setDetailTable

public void setDetailTable(com.americancoders.edi.Table inTable)
sets detail table for the Transaction Set

Parameters:
inTable - Table

setSummaryTable

public void setSummaryTable(com.americancoders.edi.Table inTable)
sets summary table for the Transaction Set

Parameters:
inTable - Table

getTemplateTransactionSet

public com.americancoders.edi.TemplateTransactionSet getTemplateTransactionSet()
return the transactionset's template

Returns:
TemplateTransactionSet

getFormat

public int getFormat()
returns the Transaction Set format

Returns:
int

getID

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

Specified by:
getID in interface IIdentifier
Specified by:
getID in class SegmentContainer
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 com.americancoders.edi.Table getHeaderTable()
returns header table for the Transaction Set

Returns:
Table

getDetailTable

public com.americancoders.edi.Table getDetailTable()
returns detail table for the Transaction Set

Returns:
Table

getSummaryTable

public com.americancoders.edi.Table getSummaryTable()
returns summary table for the Transaction Set

Returns:
Table

setXMLTag

public void setXMLTag(java.lang.String inXMLTag)
sets the xml tag field

Parameters:
inXMLTag - String xml tag id

getXMLTag

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

Specified by:
getXMLTag in interface IIdentifier
Returns:
String tag value

validate

public void validate()
              throws OBOEException
validates segment syntax for correct DataElements

Throws:
OBOEException - indicates why segment is invalid

validate

public void validate(com.americancoders.edi.DocumentErrors inDErr)
              throws OBOEException
validates segment syntax for correct DataElements
doesn't throw exception, places error text in DocumentErrors object

OBOEException

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:
formatType - int format type, x12, edifact, xml...
Returns:
String formattedOutput

writeFormattedText

public void writeFormattedText(java.io.Writer inWriter,
                               int formatType)
                        throws java.io.IOException
like getFormattedText; writes to a Writer object instead of building a string.

Parameters:
inWriter - writer - object written to
formatType - - format type see TransactionSet
Throws:
OBOEException
java.io.IOException

setTrailerFields

public void setTrailerFields()
sets the SE (for X12) or UNT (for EDIFact) control number and count fields


useDefault

public void useDefault()
sets the default value for the data elements
does nothing in Basic Edition, just a stub
will call tables useDefault methods, tables will create mandatory subsegments


trim

public int trim()
trims out unused segments and returns number of used segments

Overrides:
trim in class SegmentContainer
Returns:
int

setParent

public void setParent(com.americancoders.edi.IContainedObject inParent)
sets parent attribute

Specified by:
setParent in interface IContainedObject
Parameters:
inParent - TemplateSegmentContainer

getParent

public com.americancoders.edi.IContainedObject getParent()
gets parent attribute

Specified by:
getParent in interface IContainedObject
Returns:
TemplateSegmentContainer

getTemplateSegmentContainer

public com.americancoders.edi.TemplateSegmentContainer getTemplateSegmentContainer()
Description copied from interface: ISegmentContainer
return segment container template

Specified by:
getTemplateSegmentContainer in interface ISegmentContainer
Returns:
TemplateSegmentContainer

Open Business Objects for EDI
v3.6.0


OBOE is a trademark or registered trademark of American Coders, Ltd. in the US and other countries.
Copyright 1999-2004 American Coders, Ltd.
POB 97462
Raleigh NC 27624 USA
All Rights Reserved.