All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.access.FieldDescription

java.lang.Object
   |
   +----com.ibm.as400.access.FieldDescription

public abstract class FieldDescription
extends Object
implements Serializable
The FieldDescription class is an abstract base class that allows the user to describe the data in a field with an AS400DataType object and a name. Optionally, the user can specify a data definition specification (DDS) field name and DDS keywords if the field will be used with the record level access classes to define a RecordFormat object with which to create an AS/400 physical file. The FieldDescription class contains methods to set and get field attributes that are common to all field types.

Examples


Constructor Index

 o FieldDescription()
Constructs a FieldDescription object.
 o FieldDescription(AS400DataType, String)
Constructs a FieldDescription object.
 o FieldDescription(AS400DataType, String, String)
Constructs a FieldDescription object.

Method Index

 o getALIAS()
Returns the value specified for the ALIAS keyword for this field.
 o getALWNULL()
Returns the value specified for the ALWNULL keyword for this field.
 o getCOLHDG()
Returns the value specified for the COLHDG keyword for this field.
 o getDataType()
Returns the AS400DataType object describing this field, as specified on construction.
 o getDDSName()
Returns the DDS name of this field, as specified on the construct.
 o getDFT()
Returns the value specified for the DFT keyword for this field.
 o getFieldName()
Returns the name of this field.
 o getKeyFieldFunctions()
Returns the string specified for any key field-level keywords for this field.
 o getLength()
Returns the length of the field.
 o getREFFLD()
Returns the value specified for the REFFLD keyword for this field.
 o getTEXT()
Returns the value specified for the TEXT keyword for this field.
 o setALIAS(String)
Sets the value for the ALIAS keyword for this field.
 o setALWNULL(boolean)
Sets the value for the ALWNULL keyword for this field.
 o setCOLHDG(String)
Sets the value for the COLHDG keyword for this field.
 o setDataType(AS400DataType)
Sets the AS400DataType object describing this field.
 o setDDSName(String)
Sets the DDS name of this field.
 o setFieldName(String)
Sets the name of this field.
 o setKeyFieldFunctions(String[])
Sets the string to be specified for all key field-level keywords for this field.
 o setREFFLD(String)
Sets the value to be specified for the REFFLD keyword for this field.
 o setTEXT(String)
Sets the value to be specified for the TEXT keyword for this field.

Constructors

 o FieldDescription
 protected FieldDescription()
Constructs a FieldDescription object.

 o FieldDescription
 protected FieldDescription(AS400DataType dataType,
                            String name)
Constructs a FieldDescription object. It uses the specified data type and name of the field. The length of the field will be the length specified on the AS400DataType object. The DDS name of the field will be name if name is 10 characters or less. The DDS name of the field will be name truncated to 10 characters if name is greater than 10 characters.

Parameters:
dataType - Describes the field and provides the conversion capability for the contents of the field.
name - The name of the field.
 o FieldDescription
 protected FieldDescription(AS400DataType dataType,
                            String name,
                            String ddsName)
Constructs a FieldDescription object. It uses the specified data type, name, and DDS name of the field. The length of the field will be the length specified on the AS400DataType object.

Parameters:
dataType - Describes the field and provides the conversion capability for the contents of the field.
name - The name of the field.
ddsName - The DDS name of this field. This is the name of the field as it would appear in a DDS description of the field. The length of ddsName must be 10 characters or less.

Methods

 o getALIAS
 public String getALIAS()
Returns the value specified for the ALIAS keyword for this field.

Returns:
The value specified for the ALIAS keyword for this field. If ALIAS was not specified for this field, an empty string is returned.
 o getALWNULL
 public boolean getALWNULL()
Returns the value specified for the ALWNULL keyword for this field.

Returns:
The value specified for the ALWNULL keyword. If ALWNULL was not specified for this field, false is returned.
 o getCOLHDG
 public String getCOLHDG()
Returns the value specified for the COLHDG keyword for this field.

Returns:
The value specified for the COLHDG keyword for this field. If COLHDG was not specified for this field, an empty string is returned.
 o getDataType
 public AS400DataType getDataType()
Returns the AS400DataType object describing this field, as specified on construction.

Returns:
The AS400DataType object that describes this field. If the data type has not been specified for this field, null is returned.
 o getDFT
 public Object getDFT()
Returns the value specified for the DFT keyword for this field.

Returns:
The value specified for the DFT keyword for this field. If DFT was not specified for this field, null is returned.
 o getDDSName
 public String getDDSName()
Returns the DDS name of this field, as specified on the construct.

Returns:
The DDS name of this field. If the DDS name for this field has not been specified, an empty string is returned.
 o getFieldName
 public String getFieldName()
Returns the name of this field.

Returns:
The name of this field. If the field name for this field has not been specified, an empty string is returned.
 o getKeyFieldFunctions
 public String[] getKeyFieldFunctions()
Returns the string specified for any key field-level keywords for this field.

Returns:
The key field-level keywords that have been specified for this key field. If no key field functions have been specified, null is returned.
 o getLength
 public int getLength()
Returns the length of the field. If this field is a character field (single byte or double byte, date, time, timestamp), the length is the number of characters allowed in the field. If this field is a numeric field (binary, float, packed, zoned), the length is the total number of digits allowed in the field. If this field is a hexadecimal field, the length is the number of bytes allowed in the field.

Returns:
The length of the field.
 o getREFFLD
 public String getREFFLD()
Returns the value specified for the REFFLD keyword for this field.

Returns:
The value specified for the REFFLD keyword for this field. If REFFLD was not specified for this field, an empty string is returned.
 o getTEXT
 public String getTEXT()
Returns the value specified for the TEXT keyword for this field.

Returns:
The value specified for the TEXT keyword for this field. If TEXT was not specified for this field, an empty string is returned.
 o setALIAS
 public void setALIAS(String alias)
Sets the value for the ALIAS keyword for this field.

Parameters:
alias - The alias for this field.
 o setALWNULL
 public void setALWNULL(boolean allowNull)
Sets the value for the ALWNULL keyword for this field.

Parameters:
allowNull - true if null is allowed; false otherwise.
 o setCOLHDG
 public void setCOLHDG(String colHdg)
Sets the value for the COLHDG keyword for this field.

Parameters:
colHdg - The value for the COLHDG keyword for this field.
Format: "'Col heading 1' 'Col heading 2' 'Col heading 3'"
Examples:
                        String colHdg = "'Name'";
                        String colHdg = "'Employee' 'Number'";
                        String colHdg = "'Name' 'And' 'Address'";
                     
 o setDataType
 protected void setDataType(AS400DataType dataType)
Sets the AS400DataType object describing this field.

Parameters:
dataType - The AS400DataType that describes this field. The dataType cannot be null.
 o setDDSName
 public void setDDSName(String ddsName)
Sets the DDS name of this field.

Parameters:
ddsName - The DDS name of this field. The ddsName cannot be more than 10 characters in length.
 o setFieldName
 public void setFieldName(String fieldName)
Sets the name of this field.

Parameters:
fieldName - The name of this field. The fieldName cannot be null.
 o setKeyFieldFunctions
 public void setKeyFieldFunctions(String keyFunctions[])
Sets the string to be specified for all key field-level keywords for this field.

Parameters:
keyFunctions - The key field-level keywords to be specified for this key field. The keyFunctions must contain at least one element.
 o setREFFLD
 public void setREFFLD(String refFld)
Sets the value to be specified for the REFFLD keyword for this field.

Parameters:
refFld - The value for the REFFLD keyword for this field.
 o setTEXT
 public void setTEXT(String text)
Sets the value to be specified for the TEXT keyword for this field.

Parameters:
text - The value for the TEXT keyword for this field. The single quotes required to surround the TEXT keyword value are added by this class. The text must be 50 characters or less in length.

All Packages  Class Hierarchy  This Package  Previous  Next  Index