Open Business Objects for EDI
v3.6.0

com.americancoders.edi
Class TemplateComposite

java.lang.Object
  |
  +--com.americancoders.edi.TemplateComposite
All Implemented Interfaces:
java.io.Externalizable, IContainedObject, IIdentifier, ITemplateElementContainer, java.io.Serializable

public class TemplateComposite
extends java.lang.Object
implements IIdentifier, java.io.Externalizable, IContainedObject, ITemplateElementContainer

Template Composite holds preliminary structure of Composites

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 description
          composite description
protected  java.lang.String id
          composite id
protected  java.lang.String name
          composite name
protected  int occurs
          occurs some many times
protected  com.americancoders.edi.IContainedObject parent
           
protected  char required
          required indictor
protected  int sequence
          composite sequeunce within segment
protected  java.util.Vector templateDEVector
          where its de's go.
protected  boolean used
           
protected  java.lang.String xmlTag
          composite XML tag
 
Constructor Summary
TemplateComposite()
          Constructor
TemplateComposite(java.lang.String inId, java.lang.String inName, char inRequired, int inSequence, java.lang.String inDescription, java.lang.String inXMLTag, com.americancoders.edi.IContainedObject inParent, int inOccurs, boolean inUsed)
          TemplateComposite, there are two flavors of composites Templates and regular templates are used to define a composite dynamically and are used to build the static form of composites contains template data element
 
Method Summary
 void addTemplateComposite(com.americancoders.edi.TemplateComposite inTemplateComposite)
           
 void addTemplateDE(com.americancoders.edi.TemplateDE inTemplateDE)
          adds TemplateDE to container
checks for duplicate entry at sequence position
 int doYouUseThisElement(java.lang.String inID, int startAt)
          routine to ask if it uses a dataelement
 int doYouUseThisXMLElement(java.lang.String inXML, int startAt)
          routine to ask if it uses a dataelement by its XML Tag
 java.lang.String getDescription()
          returns the Description for the Segment
 java.lang.String getEmptyData()
          helper routine to get fields that are not built
 java.lang.String getID()
          gets TemplateComposite id
 java.lang.String getName()
          gets TemplateComposite name
 int getOccurs()
          gets the occurs value
 com.americancoders.edi.IContainedObject getParent()
          gets parent attribute
 char getRequired()
          gets required indicator
 int getSequence()
          gets sequence
 com.americancoders.edi.TemplateDE getTemplateDE(int at)
          gets TemplateDE from TemplateDE container by position
 com.americancoders.edi.TemplateDE getTemplateDE(java.lang.String id)
          gets TemplateDE from TemplateDE container by ID
 int getTemplateDESize()
          returns the number of elements in DEVector
 java.lang.String getXMLTag()
          returns the xml tag field
 boolean isTemplateComposite(int at)
           
 boolean isTemplateDE(int at)
          tests if the element at a position is a TemplateDE
 boolean isUsed()
          returns used attribute
 void readExternal(java.io.ObjectInput in)
          used by externalize methods
 void setDescription(java.lang.String inDesc)
          sets Description for the Segmemt
 void setID(java.lang.String inID)
          sets TemplateComposite id
 void setName(java.lang.String inName)
          sets composite name
 void setOccurs(int inOccurs)
          sets the occurs value
 void setParent(com.americancoders.edi.IContainedObject inParent)
          sets parent attribute
 void setRequired(char inRequired)
           
 void setSequence(int inSequence)
          sets sequence
 void setUsed(boolean used)
          sets used attribute
 void setXMLTag(java.lang.String inXMLTag)
          sets the xmltag field
 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

id

protected java.lang.String id
composite id


name

protected java.lang.String name
composite name


required

protected char required
required indictor


sequence

protected int sequence
composite sequeunce within segment


description

protected java.lang.String description
composite description


xmlTag

protected java.lang.String xmlTag
composite XML tag


templateDEVector

protected java.util.Vector templateDEVector
where its de's go.


occurs

protected int occurs
occurs some many times


used

protected boolean used

parent

protected com.americancoders.edi.IContainedObject parent
Constructor Detail

TemplateComposite

public TemplateComposite()
Constructor


TemplateComposite

public TemplateComposite(java.lang.String inId,
                         java.lang.String inName,
                         char inRequired,
                         int inSequence,
                         java.lang.String inDescription,
                         java.lang.String inXMLTag,
                         com.americancoders.edi.IContainedObject inParent,
                         int inOccurs,
                         boolean inUsed)
TemplateComposite, there are two flavors of composites Templates and regular

templates are used to define a composite dynamically

and are used to build the static form of composites

contains template data element

Parameters:
inId - String id of composite
inName - composite name
inRequired - required indicator
inSequence - sequence within segment
inDescription - String description
inXMLTag - String xml tag
inParent - owning Object
inOccurs - int
inUsed - boolean
Method Detail

isUsed

public boolean isUsed()
returns used attribute

Returns:
boolean

setUsed

public void setUsed(boolean used)
sets used attribute

Parameters:
used - boolean

getTemplateDESize

public int getTemplateDESize()
returns the number of elements in DEVector

Specified by:
getTemplateDESize in interface ITemplateElementContainer
Returns:
int count

setID

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

Parameters:
inID - String id of composite

setName

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

Parameters:
inName - String name

getID

public java.lang.String getID()
gets TemplateComposite id

Specified by:
getID in interface IIdentifier
Returns:
string inID composite id

getName

public java.lang.String getName()
gets TemplateComposite name

Returns:
string composite name

setRequired

public void setRequired(char inRequired)
Parameters:
inRequired - char required indicator

getRequired

public char getRequired()
gets required indicator

Returns:
char

setSequence

public void setSequence(int inSequence)
sets sequence

Parameters:
inSequence - int sequence within segment

getSequence

public int getSequence()
gets sequence

Returns:
int sequence

setDescription

public void setDescription(java.lang.String inDesc)
sets Description for the Segmemt

Parameters:
inDesc - String description

getDescription

public java.lang.String getDescription()
returns the Description for the Segment

Returns:
String

setXMLTag

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

Parameters:
inXMLTag - String XML Tag

getXMLTag

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

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

addTemplateDE

public void addTemplateDE(com.americancoders.edi.TemplateDE inTemplateDE)
adds TemplateDE to container
checks for duplicate entry at sequence position

Specified by:
addTemplateDE in interface ITemplateElementContainer
Parameters:
inTemplateDE - TemplateDE to add
Throws:
OBOEException - -Sequence position already filled

getTemplateDE

public com.americancoders.edi.TemplateDE getTemplateDE(int at)
gets TemplateDE from TemplateDE container by position

Parameters:
at - int position of dataelement
position is relative to 1.
Returns:
TemplateDE at the specified position

getTemplateDE

public com.americancoders.edi.TemplateDE getTemplateDE(java.lang.String id)
gets TemplateDE from TemplateDE container by ID

Parameters:
id - of TemplateDE in container
Returns:
TemplateDE null if not found

isTemplateDE

public boolean isTemplateDE(int at)
tests if the element at a position is a TemplateDE

Specified by:
isTemplateDE in interface ITemplateElementContainer
Parameters:
at - int position
position is relative to 1.
Returns:
boolean

doYouUseThisElement

public int doYouUseThisElement(java.lang.String inID,
                               int startAt)
routine to ask if it uses a dataelement

Parameters:
inID - String id
Returns:
boolen true the segment id is part of this group

doYouUseThisXMLElement

public int doYouUseThisXMLElement(java.lang.String inXML,
                                  int startAt)
routine to ask if it uses a dataelement by its XML Tag

Parameters:
inXML - tag of dataelement
startAt - int position
Returns:
int position , -1 not found

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 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:
out - ObjectInput object input 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:
parent container

setOccurs

public void setOccurs(int inOccurs)
sets the occurs value

Parameters:
inOccurs -

getOccurs

public int getOccurs()
gets the occurs value

Returns:
int

getEmptyData

public java.lang.String getEmptyData()
helper routine to get fields that are not built

Returns:
String

addTemplateComposite

public void addTemplateComposite(com.americancoders.edi.TemplateComposite inTemplateComposite)
                          throws OBOEException
Specified by:
addTemplateComposite in interface ITemplateElementContainer
OBOEException

isTemplateComposite

public boolean isTemplateComposite(int at)
Specified by:
isTemplateComposite in interface ITemplateElementContainer

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.