Open Business Objects for EDI
v3.6.0

com.americancoders.edi.x12
Class X12Envelope

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

public class X12Envelope
extends Envelope

class for wrapping a X12 EDI transaction set within an EDI Envelope


Nested Class Summary
 
Nested classes inherited from class com.americancoders.edi.Envelope
Envelope.PreDelimiter
 
Field Summary
static java.lang.String idDeferredDeliveryRequest
           
static java.lang.String idGradeofServiceRequest
           
static java.lang.String idInterchangeAcknowledgment
           
static java.lang.String idInterchangeHeader
          segment constants
static java.lang.String idInterchangeTrailer
           
 
Fields inherited from class com.americancoders.edi.Envelope
ACH_FORMAT, ACH_FORMAT_FOR_CBR_PBR, CSV_FORMAT, EDIFact_ESCAPE_CHARACTER, EDIFact_FIELD_DELIMITER, EDIFACT_FORMAT, EDIFact_GROUP_DELIMITER, EDIFact_REPEAT_DELIMITER, EDIFact_SEGMENT_DELIMITER, escapeCharacter, fieldDelimiter, FIXED_LENGTH_FORMAT, format, functionalGroups, groupDelimiter, myTemplate, PIXES_FORMAT, PREBUILD_ESCAPE_DELIMITER, PREBUILD_FIELD_DELIMITER, PREBUILD_FORMAT, PREBUILD_GROUP_DELIMITER, PREBUILD_REPEAT_DELIMITER, PREBUILD_SEGID_DELIMITER, PREBUILD_SEGMENT_DELIMITER, repeatDelimiter, response, revision, segmentDelimiter, TRADACOMS_ESCAPE_CHARACTER, TRADACOMS_FIELD_DELIMITER, TRADACOMS_FORMAT, TRADACOMS_GROUP_DELIMITER, TRADACOMS_REPEAT_DELIMITER, TRADACOMS_SEGID_DELIMITER, TRADACOMS_SEGMENT_DELIMITER, VALID_XML_FORMAT, VALID_XML_FORMAT_WITH_POSITION, X12_ESCAPE_CHARACTER, X12_FIELD_DELIMITER, X12_FORMAT, X12_GROUP_DELIMITER, X12_REPEAT_DELIMITER, X12_SEGMENT_DELIMITER, XML_FORMAT
 
Fields inherited from class com.americancoders.edi.SegmentContainer
container, dupSegment, myTemplateContainer
 
Constructor Summary
X12Envelope()
          instantiates the class from all related OBOE classes
X12Envelope(com.americancoders.edi.TemplateEnvelope inTempEnv)
          instantiates the class from a TemplateEnvelope, creates mandatory segments ISA and IEA and creates one emtpy functional group
 
Method Summary
 com.americancoders.edi.Segment createDeferred_Delivery_Request()
          creates, sets and returns the Deferred_Delivery_Request
 com.americancoders.edi.FunctionalGroup createFunctionalGroup()
          creates a basic functionalgroup object
 com.americancoders.edi.Segment createGrade_of_Service_Request()
          creates, sets and returns the Grade_of_Service_Request
 com.americancoders.edi.Segment createInterchange_Acknowledgment()
          creates, adds and returns a Interchange_Acknowledgment from the vector(container)
check for runtime array out of bounds exception
 com.americancoders.edi.Segment createInterchange_Header()
          creates, sets and returns the Interchange Control Header built for the envelope
 com.americancoders.edi.Segment createInterchange_Trailer()
          creates, sets and returns the Interchange Control Trailer built for the envelope
 com.americancoders.edi.Segment getDeferred_Delivery_Request()
          gets the Deferred_Delivery_Request
 java.lang.String getFormattedText(int inFormat)
          returns a formatted document as a String
 com.americancoders.edi.FunctionalGroup getFunctionalGroup(int pos)
          gets a Functional Group object from the vector (container);
check for runtime array out of bounds exception
 int getFunctionalGroupCount()
          gets the count of Functional Group object in the vector (container);
 java.util.Vector getFunctionalGroups()
          gets the Vector of Functional Group objects
 com.americancoders.edi.Segment getGrade_of_Service_Request()
          gets the Grade_of_Service_Request
 com.americancoders.edi.Segment getInterchange_Acknowledgment(int pos)
          gets a Interchange_Acknowledgment from the vector(container)
check for runtime array out of bounds exception
 int getInterchange_AcknowledgmentCount()
          gets the count of Interchange_Acknowledgment in the vector(container)
 com.americancoders.edi.Segment getInterchange_Header()
          returns the Interchange Control Header built for the envelope
 com.americancoders.edi.Segment getInterchange_Trailer()
          returns the Interchange Control Trailer built for the envelope
 void parse(org.w3c.dom.Node node)
           
 boolean parse(java.io.PushbackInputStream pis)
           
 void setDelimitersInHeader()
          sets the Delimter fields in the header
 void setFGCountInTrailer()
          sets the functional group count in the trailer.
 void validate()
          validates
 void validate(com.americancoders.edi.DocumentErrors inDErr)
          validate contents of envelope
doesn't throw exception but places errors in DocumentErrors object.
 void writeFormattedText(java.io.Writer inWriter, int inFormat)
          like getFormattedText; writes to a Writer object instead of building a string.
 
Methods inherited from class com.americancoders.edi.Envelope
addFunctionalGroup, getFormat, getFormat, getID, getParent, getResponse, getRevision, getTemplateSegment, getTemplateSegmentContainer, getXMLTag, processEDIEnvelope, setDelimiters, setDelimitersFromProperties, setFormat, setParent, setResponse, setRevision, toString, trim
 
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, parse, removeSegment, removeSegment, removeSegment, removeSegment, resetToFirstEquivalentSegment, setSegmentAt, setSegmentAt, whyNotUsed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.americancoders.edi.ISegmentContainer
addSegment, createSegment, getSegment, getSegment, getSegmentCount, removeSegment
 

Field Detail

idInterchangeHeader

public static final java.lang.String idInterchangeHeader
segment constants

See Also:
Constant Field Values

idGradeofServiceRequest

public static final java.lang.String idGradeofServiceRequest
See Also:
Constant Field Values

idInterchangeAcknowledgment

public static final java.lang.String idInterchangeAcknowledgment
See Also:
Constant Field Values

idDeferredDeliveryRequest

public static final java.lang.String idDeferredDeliveryRequest
See Also:
Constant Field Values

idInterchangeTrailer

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

X12Envelope

public X12Envelope()
instantiates the class from all related OBOE classes


X12Envelope

public X12Envelope(com.americancoders.edi.TemplateEnvelope inTempEnv)
            throws OBOEException
instantiates the class from a TemplateEnvelope, creates mandatory segments ISA and IEA and creates one emtpy functional group

Parameters:
inTempEnv - TemplateEnvelope to build this class with
Throws:
OBOEException - missing segment definition in envelope xml.
Method Detail

parse

public void parse(org.w3c.dom.Node node)
           throws OBOEException,
                  java.io.FileNotFoundException,
                  java.io.IOException
Specified by:
parse in class Envelope
OBOEException
java.io.FileNotFoundException
java.io.IOException

parse

public boolean parse(java.io.PushbackInputStream pis)
              throws OBOEException,
                     java.io.FileNotFoundException,
                     java.io.IOException
Specified by:
parse in class Envelope
OBOEException
java.io.FileNotFoundException
java.io.IOException

createFunctionalGroup

public com.americancoders.edi.FunctionalGroup createFunctionalGroup()
creates a basic functionalgroup object

Specified by:
createFunctionalGroup in class Envelope
Returns:
X12FunctionalGroup

getInterchange_Header

public com.americancoders.edi.Segment getInterchange_Header()
returns the Interchange Control Header built for the envelope

Specified by:
getInterchange_Header in class Envelope
Returns:
Segment

getGrade_of_Service_Request

public com.americancoders.edi.Segment getGrade_of_Service_Request()
gets the Grade_of_Service_Request

Returns:
Interchange_Control_Header segment

getDeferred_Delivery_Request

public com.americancoders.edi.Segment getDeferred_Delivery_Request()
gets the Deferred_Delivery_Request

Returns:
Interchange_Control_Header segment

getInterchange_AcknowledgmentCount

public int getInterchange_AcknowledgmentCount()
gets the count of Interchange_Acknowledgment in the vector(container)

Returns:
int count

getInterchange_Acknowledgment

public com.americancoders.edi.Segment getInterchange_Acknowledgment(int pos)
gets a Interchange_Acknowledgment from the vector(container)
check for runtime array out of bounds exception

Returns:
Interchange_Acknowledgment Segment

getFunctionalGroupCount

public int getFunctionalGroupCount()
gets the count of Functional Group object in the vector (container);

Specified by:
getFunctionalGroupCount in class Envelope
Returns:
int count

getFunctionalGroup

public com.americancoders.edi.FunctionalGroup getFunctionalGroup(int pos)
gets a Functional Group object from the vector (container);
check for runtime array out of bounds exception

Specified by:
getFunctionalGroup in class Envelope
Parameters:
pos - int position within container.
Returns:
a FunctionalGroup object

getFunctionalGroups

public java.util.Vector getFunctionalGroups()
gets the Vector of Functional Group objects

Specified by:
getFunctionalGroups in class Envelope
Returns:
a Vector of FunctionalGroup objects

getInterchange_Trailer

public com.americancoders.edi.Segment getInterchange_Trailer()
returns the Interchange Control Trailer built for the envelope

Specified by:
getInterchange_Trailer in class Envelope
Returns:
Segment

createInterchange_Header

public com.americancoders.edi.Segment createInterchange_Header()
creates, sets and returns the Interchange Control Header built for the envelope

Returns:
Segment - can return null if templateenvelope is null or segment not defined in envelope xml rules file

createGrade_of_Service_Request

public com.americancoders.edi.Segment createGrade_of_Service_Request()
creates, sets and returns the Grade_of_Service_Request

Returns:
Segment - can return null if templateenvelope is null or segment not defined in envelope xml rules file

createDeferred_Delivery_Request

public com.americancoders.edi.Segment createDeferred_Delivery_Request()
creates, sets and returns the Deferred_Delivery_Request

Returns:
Segment - can return null if templateenvelope is null or segment not defined in envelope xml rules file

createInterchange_Acknowledgment

public com.americancoders.edi.Segment createInterchange_Acknowledgment()
creates, adds and returns a Interchange_Acknowledgment from the vector(container)
check for runtime array out of bounds exception

Returns:
Segment - can return null if templateenvelope is null or segment not defined in envelope xml rules file

createInterchange_Trailer

public com.americancoders.edi.Segment createInterchange_Trailer()
creates, sets and returns the Interchange Control Trailer built for the envelope

Returns:
Segment - can return null if templateenvelope is null or segment not defined in envelope xml rules file

setDelimitersInHeader

public void setDelimitersInHeader()
                           throws OBOEException
sets the Delimter fields in the header

Specified by:
setDelimitersInHeader in class Envelope
OBOEException

setFGCountInTrailer

public void setFGCountInTrailer()
                         throws OBOEException
sets the functional group count in the trailer. also sets the control number from header

Specified by:
setFGCountInTrailer in class Envelope
OBOEException

getFormattedText

public java.lang.String getFormattedText(int inFormat)
returns a formatted document as a String

Specified by:
getFormattedText in class Envelope
Parameters:
inFormat - int - format type see TransactionSet
Returns:
String the formatted document

writeFormattedText

public void writeFormattedText(java.io.Writer inWriter,
                               int inFormat)
                        throws OBOEException,
                               java.io.IOException
Description copied from class: Envelope
like getFormattedText; writes to a Writer object instead of building a string.

Specified by:
writeFormattedText in class Envelope
Parameters:
inWriter - writer - object written to
inFormat - int - format type see TransactionSet
Throws:
OBOEException
java.io.IOException
See Also:
Envelope.writeFormattedText(Writer, int)

validate

public void validate()
              throws OBOEException
validates

Specified by:
validate in class Envelope
Throws:
OBOEException - indicates why envelope is invalid

validate

public void validate(com.americancoders.edi.DocumentErrors inDErr)
validate contents of envelope
doesn't throw exception but places errors in DocumentErrors object.

Specified by:
validate in class Envelope
Parameters:
inDErr - DocumentErrors object

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.