Open Business Objects for EDI
v3.6.0

com.americancoders.edi
Class TemplateLoop

java.lang.Object
  |
  +--com.americancoders.edi.TemplateSegmentContainer
        |
        +--com.americancoders.edi.TemplateLoopContainer
              |
              +--com.americancoders.edi.TemplateLoop
All Implemented Interfaces:
java.io.Externalizable, IContainedObject, IIdentifier, ITemplateSegmentContainer, java.io.Serializable

public class TemplateLoop
extends TemplateLoopContainer
implements IContainedObject, java.io.Externalizable

class for Template Loops a general class for the segment loops.

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.
See Also:
Serialized Form

Field Summary
protected  java.lang.String id
          String id
protected  java.lang.String name
          String name
protected  int occurs
          how many times it can occur
protected  com.americancoders.edi.IContainedObject parent
           
protected  char required
          required indicator
protected  boolean used
           
protected  java.lang.String xmlTag
          String XML tag
 
Fields inherited from class com.americancoders.edi.TemplateSegmentContainer
templateContainer
 
Constructor Summary
TemplateLoop()
          constructor takes no parameters
TemplateLoop(java.lang.String inID, java.lang.String inName, int inOccurs, char inRequired, java.lang.String xmlTag, boolean inUsed, com.americancoders.edi.IContainedObject inParent)
          Constructor
 
Method Summary
 boolean canYouPrevalidate()
          returns true if the template loop can prevalidate an incoming edi transaction segment.
 java.lang.String getID()
          returns the Loop id
 java.lang.String getName()
          returns the Loop name
 int getOccurs()
          gets occurance value
 com.americancoders.edi.IContainedObject getParent()
          gets parent attribute
 char getRequired()
          gets required flag
 java.lang.String getXMLTag()
          returns the xml tag field
 boolean isThisYou(com.americancoders.edi.ITokenizer inToken)
          looking into the tokenized string we ask the first segment's first idde field if the data in the same position is one of its codes
 boolean isUsed()
           
 void readExternal(java.io.ObjectInput in)
          used by externalize methods
 void setID(java.lang.String inID)
          sets the id
 void setName(java.lang.String inName)
          sets the name
 void setOccurs(int inOccurs)
          sets occurance value
 void setParent(com.americancoders.edi.IContainedObject inParent)
          sets parent attribute
 void setRequired(char inRequired)
          sets required value
 void setUsed(boolean used)
           
 void setXMLTag(java.lang.String inXMLTag)
          sets the xml tag field
 void whyNotYou(com.americancoders.edi.Tokenizer et)
          asking template what parsing id field it doesn't like so that it would create a prevalidated segment.
 void writeExternal(java.io.ObjectOutput out)
          used by externalize methods
 
Methods inherited from class com.americancoders.edi.TemplateLoopContainer
addTemplateLoop, createSegment, getContainerSize, getTemplateLoop, getTemplateLoop, getTemplateLoopByIDAndName, isLoop
 
Methods inherited from class com.americancoders.edi.TemplateSegmentContainer
addTemplateSegment, getCount, getCount, getTemplateSegment, getTemplateSegment, getTemplateSegment, getTemplateSegmentByIDAndName, isSegment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected java.lang.String id
String id


name

protected java.lang.String name
String name


occurs

protected int occurs
how many times it can occur


required

protected char required
required indicator


xmlTag

protected java.lang.String xmlTag
String XML tag


used

protected boolean used

parent

protected com.americancoders.edi.IContainedObject parent
Constructor Detail

TemplateLoop

public TemplateLoop()
constructor takes no parameters


TemplateLoop

public TemplateLoop(java.lang.String inID,
                    java.lang.String inName,
                    int inOccurs,
                    char inRequired,
                    java.lang.String xmlTag,
                    boolean inUsed,
                    com.americancoders.edi.IContainedObject inParent)
Constructor

Parameters:
inID - loop id
inName - loop name
inOccurs - int occursance count
inRequired - char required indicator
xmlTag - String XML tag
inUsed - boolean
inParent - IContainedObject parent container
Method Detail

isUsed

public boolean isUsed()

setUsed

public void setUsed(boolean used)

setID

public void setID(java.lang.String inID)
sets the id

Parameters:
inID - String id

getID

public java.lang.String getID()
returns the Loop id

Specified by:
getID in interface IIdentifier
Returns:
String

setName

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

Parameters:
inName - String name

getName

public java.lang.String getName()
returns the Loop name

Returns:
String

setOccurs

public void setOccurs(int inOccurs)
sets occurance value

Parameters:
inOccurs - int

getOccurs

public int getOccurs()
gets occurance value

Returns:
int occurs

setRequired

public void setRequired(char inRequired)
sets required value

Parameters:
inRequired - char

getRequired

public char getRequired()
gets required flag

Returns:
char required

setXMLTag

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

Parameters:
inXMLTag - String tag

getXMLTag

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

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

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:
in - ObjectInput 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:
out - ObjectOutput stream
Throws:
java.io.IOException - java.io error

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

canYouPrevalidate

public boolean canYouPrevalidate()
returns true if the template loop can prevalidate an incoming edi transaction segment. If yes then this segment is the first segment for this loop. It actually defines the loop.
implemented for HIPAA

Returns:
boolean

isThisYou

public boolean isThisYou(com.americancoders.edi.ITokenizer inToken)
looking into the tokenized string we ask the first segment's first idde field if the data in the same position is one of its codes

Returns:
boolean

whyNotYou

public void whyNotYou(com.americancoders.edi.Tokenizer et)
asking template what parsing id field it doesn't like so that it would create a prevalidated segment.

Returns:
string

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.