Open Business Objects for EDI
v3.6.0

com.americancoders.edi
Class Loop

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

public class Loop
extends LoopAndSegmentContainer

class for Loops OBOE - Open Business Objects for EDI

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.TemplateLoop myTemplate
          TemplateSegment that can build this Segment
protected  com.americancoders.edi.IContainedObject parent
          owning object
 
Fields inherited from class com.americancoders.edi.SegmentContainer
container, dupSegment, myTemplateContainer
 
Constructor Summary
Loop(com.americancoders.edi.TemplateLoop inTemplateLoop, com.americancoders.edi.IContainedObject inParent)
          create a Loop based on its template
 
Method Summary
 com.americancoders.edi.Segment createSegment(java.lang.String ID)
          this is here as a stub because of the Segment container interface
 java.lang.String get()
          returns all the data associated with the Segment
dataelements separated by '*'
composites separated by '<', note data elements within composites are seperated by ':'
 java.lang.String getFixedLengthFormattedText()
          returns fixed length formatted text
 java.lang.String getFormattedText(int formatType)
          returns the formatted text
 java.lang.String getID()
          gets the Segment id
 java.lang.String getName()
          gets the Segment Name
 int getOccurs()
          returns the occurs value
 com.americancoders.edi.IContainedObject getParent()
          gets parent attribute
 char getRequired()
          gets required flag
 int getSegmentSize()
          returns the number of Segments within this Segment
 com.americancoders.edi.TemplateLoop getTemplate()
          returns the TemplateSegment used to build the Segment
 com.americancoders.edi.TemplateSegmentContainer getTemplateSegmentContainer()
          return segment container template
 java.lang.String getXMLTag()
          returns the xml tag field
 boolean isUsed()
          returns the used indicator
 void setParent(com.americancoders.edi.IContainedObject inParent)
          sets parent attribute
 java.lang.String toString()
          the toString method
 void useDefault()
          sets the default value for the data elements
part of Extended Edition package
will create mandatory subsegments.
 boolean validate(com.americancoders.edi.DocumentErrors inDErr)
          validates if the container is defined correctly
doesn't throw exception, places error messages in DocumentErrors object
 void writeFixedLengthFormattedText(java.io.Writer inWriter)
          returns fixed length formatted text
 void writeFormattedText(java.io.Writer inWriter, int formatType)
          writes a formatted text
 
Methods inherited from class com.americancoders.edi.LoopAndSegmentContainer
addLoop, addLoopToVector, continueParse, createLoop, defineContainer, doYouWantThisNode, doYouWantThisSegment, equivalentLoops, getContainerSize, getCount, getCount, getLoop, getLoop, getLoop, getLoop, getLoopAndSegmentCount, getLoopByDataElementValue, getLoopCount, getLoopCount, getSegmentCount, getSegmentCount, getTemplateLoopContainer, getVector, isLoop, isLoop, isNull, isVector, parse, parse, parse, removeLoop, removeLoop, removeLoop, removeLoop, resetToFirstEquivalentLoop, setLoopAt, setLoopAt, setTemplateLoopContainer, trim, validate, whyNotUsed
 
Methods inherited from class com.americancoders.edi.SegmentContainer
addSegment, addSegment, addSegment, addSegmentToVector, createSegment, createSegmentByIDAndName, equivalentSegments, getSegment, getSegment, getSegment, getSegment, getSegment, getSegment, getSegmentByDataElementValue, getSegmentCount, isSegment, isSegment, removeSegment, removeSegment, removeSegment, removeSegment, resetToFirstEquivalentSegment, setSegmentAt, setSegmentAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myTemplate

protected com.americancoders.edi.TemplateLoop myTemplate
TemplateSegment that can build this Segment


parent

protected com.americancoders.edi.IContainedObject parent
owning object

Constructor Detail

Loop

public Loop(com.americancoders.edi.TemplateLoop inTemplateLoop,
            com.americancoders.edi.IContainedObject inParent)
     throws OBOEException
create a Loop based on its template

Parameters:
inTemplateLoop - predefined Templatoop
inParent - owning Object
Throws:
OBOEException - unknown Segment
Method Detail

getTemplate

public com.americancoders.edi.TemplateLoop getTemplate()
returns the TemplateSegment used to build the Segment

Returns:
TemplateSegment

getID

public java.lang.String getID()
gets the Segment id

Specified by:
getID in interface IIdentifier
Specified by:
getID in class SegmentContainer
Returns:
String id

getName

public java.lang.String getName()
gets the Segment Name

Returns:
String Name

getOccurs

public int getOccurs()
returns the occurs value

Returns:
int occurance value

getRequired

public char getRequired()
gets required flag

Returns:
char required

getXMLTag

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

Returns:
String tag value

isUsed

public boolean isUsed()
returns the used indicator

Returns:
boolean

createSegment

public com.americancoders.edi.Segment createSegment(java.lang.String ID)
                                             throws OBOEException
this is here as a stub because of the Segment container interface

Specified by:
createSegment in interface ISegmentContainer
Overrides:
createSegment in class SegmentContainer
Parameters:
ID - String
Returns:
Segment
Throws:
OBOEException - as thrown

getSegmentSize

public int getSegmentSize()
returns the number of Segments within this Segment

Returns:
int subSegment count

getFormattedText

public java.lang.String getFormattedText(int formatType)
returns the formatted text

Parameters:
formatType - int indicating x12, edificact...
Returns:
String

getFixedLengthFormattedText

public java.lang.String getFixedLengthFormattedText()
returns fixed length formatted text

Returns:
String

writeFormattedText

public void writeFormattedText(java.io.Writer inWriter,
                               int formatType)
                        throws java.io.IOException
writes a formatted text

Parameters:
inWriter - writer object
formatType - int indicating x12, edificact...
Throws:
java.io.IOException

writeFixedLengthFormattedText

public void writeFixedLengthFormattedText(java.io.Writer inWriter)
                                   throws java.io.IOException
returns fixed length formatted text

Returns:
String
Throws:
java.io.IOException

get

public java.lang.String get()
returns all the data associated with the Segment
dataelements separated by '*'
composites separated by '<', note data elements within composites are seperated by ':'

Returns:
String for all Segments and deArray within the Segment

setParent

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

Parameters:
inParent - TemplateSegmentContainer

useDefault

public void useDefault()
sets the default value for the data elements
part of Extended Edition package
will create mandatory subsegments.
if mandatory subsegment is part of vector (collection) will create the first one


validate

public boolean validate(com.americancoders.edi.DocumentErrors inDErr)
Description copied from class: LoopAndSegmentContainer
validates if the container is defined correctly
doesn't throw exception, places error messages in DocumentErrors object

Overrides:
validate in class LoopAndSegmentContainer
Returns:
boolean true if built correctly

getParent

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

Returns:
TemplateSegmentContainer

toString

public java.lang.String toString()
the toString method

Overrides:
toString in class java.lang.Object

getTemplateSegmentContainer

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

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.