com.americancoders.edi
Class DataElement

java.lang.Object
  |
  +--com.americancoders.edi.DataElement
Direct Known Subclasses:
CharDE, DateDE, IDDE, NumericDE, RealDE, TimeDE

public class DataElement
extends java.lang.Object

class for all Data Elements

OBOE - Open Business Objects for EDI
An EDI and XML Translator Written In Java
Copyright 1998-2000 - 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:
1.4.1
Author:
Joe McVerry, American Coders Ltd.

Field Summary
protected  java.lang.String description
           
protected  java.lang.String id
           
protected  int maxLength
           
protected  int minLength
           
protected  java.lang.String referenceId
           
protected  char required
           
protected  int sequence
           
protected  java.lang.String value
           
protected  java.lang.String xmlTag
           
 
Constructor Summary
DataElement(java.lang.String inID, int inSequence, java.lang.String inShortDescription, char inRequired, int inMinLength, int inMaxLength)
          constructs the Data Element type
DataElement(java.lang.String inID, int inSequence, java.lang.String inDescription, char inRequired, int inMinLength, int inMaxLength, java.lang.String inXMLTag)
          constructs the Data Element type
DataElement(java.lang.String inValue, java.lang.String inID, int inSequence, java.lang.String inDescription, char inRequired, int inMinLength, int inMaxLength)
          constructs the Data Element type and sets its value
DataElement(java.lang.String inValue, java.lang.String inID, int inSequence, java.lang.String inDescription, char inRequired, int inMinLength, int inMaxLength, java.lang.String inXMLTag)
          constructs the Data Element type and sets its value constructs the Data Element type and sets its value
 
Method Summary
 java.lang.String get()
          returns the value for the Data Element
 java.lang.String getDescription()
          returns the Description for the Data Element
 java.lang.String getFormattedText(int formatType)
          formats text of data element
Description of DataElement is defined in the class
value is the current value set in the object
 java.lang.String getID()
          gets the Data Element id
 int getLength()
          gets the current length for the Data Element
 int getMaxLength()
          gets the maximum length for the Data Element
 int getMinLength()
          gets the minimum length for the Data Element
 int getRequired()
          gets the required indicator
 int getSequence()
          gets the Data Element sequence
 java.lang.String getType()
          returns the dataElement Type
 java.lang.String getXMLTag()
          returns the xml tag field
 void set(java.lang.String inValue)
           
 void setDescription(java.lang.String inDescription)
          sets Description for the Data Element
 void setID(java.lang.String inID)
          sets the Data Element id
 void setMaxLength(int inMaxLength)
          sets the maximum length for the Data Element
 void setMinLength(int inMinLength)
          sets the minimum length for the Data Element
 void setRequired(char inRequired)
          sets the required indicator
 void setSequence(int inSequence)
          sets the Data Element sequence
 void setValue(java.lang.String inValue)
          sets the value for the Data Element
 void setXMLTag(java.lang.String inXMLTag)
          sets the xml tag field
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sequence

protected int sequence

id

protected java.lang.String id

referenceId

protected java.lang.String referenceId

minLength

protected int minLength

maxLength

protected int maxLength

value

protected java.lang.String value

description

protected java.lang.String description

xmlTag

protected java.lang.String xmlTag

required

protected char required
Constructor Detail

DataElement

public DataElement(java.lang.String inID,
                   int inSequence,
                   java.lang.String inDescription,
                   char inRequired,
                   int inMinLength,
                   int inMaxLength,
                   java.lang.String inXMLTag)
constructs the Data Element type
Parameters:
String - x12 id
int - sequence number within structure
String - Description
char - required indicator
int - minimum allowed length
int - maximum allowed length
String - xml tag value

DataElement

public DataElement(java.lang.String inID,
                   int inSequence,
                   java.lang.String inShortDescription,
                   char inRequired,
                   int inMinLength,
                   int inMaxLength)
constructs the Data Element type
Parameters:
String - x12 id
int - sequence number within structure
String - Desctiption
char - required indicator
int - minimum allowed length
int - maximum allowed length

DataElement

public DataElement(java.lang.String inValue,
                   java.lang.String inID,
                   int inSequence,
                   java.lang.String inDescription,
                   char inRequired,
                   int inMinLength,
                   int inMaxLength)
constructs the Data Element type and sets its value
Parameters:
String - input value
int - sequence number within structure
String - Description
char - required indicator
int - minimum allowed length
int - maximum allowed length
String - xml tag value

DataElement

public DataElement(java.lang.String inValue,
                   java.lang.String inID,
                   int inSequence,
                   java.lang.String inDescription,
                   char inRequired,
                   int inMinLength,
                   int inMaxLength,
                   java.lang.String inXMLTag)
constructs the Data Element type and sets its value constructs the Data Element type and sets its value
Parameters:
String - input value
int - sequence number within structure
String - Description
char - required indicator
int - minimum allowed length
int - maximum allowed length
Method Detail

getType

public java.lang.String getType()
returns the dataElement Type
Returns:
String type

setID

public void setID(java.lang.String inID)
sets the Data Element id
Parameters:
String - edi id

getID

public java.lang.String getID()
gets the Data Element id
Returns:
String edi id

setSequence

public void setSequence(int inSequence)
sets the Data Element sequence
Parameters:
int - sequence with in the segment

getSequence

public int getSequence()
gets the Data Element sequence
Returns:
int sequence with in the segment

setValue

public void setValue(java.lang.String inValue)
sets the value for the Data Element
Parameters:
String - value

setRequired

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

setMinLength

public void setMinLength(int inMinLength)
sets the minimum length for the Data Element
Parameters:
int - sets the minimum length

setMaxLength

public void setMaxLength(int inMaxLength)
sets the maximum length for the Data Element
Parameters:
int - sets the maximum length

getRequired

public int getRequired()
gets the required indicator
Returns:
char the required indicator

getMinLength

public int getMinLength()
gets the minimum length for the Data Element
Returns:
int the defined minimum length

getMaxLength

public int getMaxLength()
gets the maximum length for the Data Element
Returns:
int the defined maximum length

getLength

public int getLength()
gets the current length for the Data Element
Returns:
int retuns length of set value, can have a null exception if value is not set.

setXMLTag

public void setXMLTag(java.lang.String inXMLTag)
sets the xml tag field
Parameters:
String - xml tag value

getXMLTag

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

set

public void set(java.lang.String inValue)

get

public java.lang.String get()
returns the value for the Data Element
Returns:
String

setDescription

public void setDescription(java.lang.String inDescription)
sets Description for the Data Element
Parameters:
String - description

getDescription

public java.lang.String getDescription()
returns the Description for the Data Element
Returns:
String description

getFormattedText

public java.lang.String getFormattedText(int formatType)
formats text of data element
Description of DataElement is defined in the class
value is the current value set in the object
Parameters:
int - formatType
  • formatType == 1 produces XML output
  • default produces "description: value"