com.ibm.as400.access

Class FieldDescription

  • java.lang.Object
    • com.ibm.as400.access.FieldDescription
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int ALIGN_LEFT
      This is only used for record level writing.
      static int ALIGN_RIGHT
      This is only used for record level writing.
    • Constructor Summary

      Constructors 
      Modifier Constructor and Description
      protected FieldDescription()
      Constructs a FieldDescription object.
      protected FieldDescription(AS400DataType dataType, java.lang.String name)
      Constructs a FieldDescription object.
      protected FieldDescription(AS400DataType dataType, java.lang.String name, java.lang.String ddsName)
      Constructs a FieldDescription object.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.String getALIAS()
      Returns the value specified for the ALIAS keyword for this field.
      boolean getALWNULL()
      Returns the value specified for the ALWNULL keyword for this field.
      java.lang.String getCOLHDG()
      Returns the value specified for the COLHDG keyword for this field.
      AS400DataType getDataType()
      Returns the AS400DataType object describing this field, as specified on construction.
      java.lang.String getDDSName()
      Returns the DDS name of this field, as specified on the construct.
      java.lang.Object getDFT()
      Returns the value specified for the DFT keyword for this field.
      java.lang.String getDFTCurrentValue()
      Returns the default value setting based on the current timestamp.
      java.lang.String getFieldName()
      Returns the name of this field.
      java.lang.String[] getKeyFieldFunctions()
      Returns the string specified for any key field-level keywords for this field.
      int getLayoutAlignment()
      Returns the layout alignment of this field.
      int getLayoutLength()
      Returns the layout length of this field.
      int getLength()
      Returns the length of this field.
      java.lang.String getREFFIL()
      Returns the value specified for the REFFIL keyword for this field.
      java.lang.String getREFFLD()
      Returns the value specified for the REFFLD keyword for this field.
      java.lang.String getREFFMT()
      Returns the value specified for the REFFMT keyword for this field.
      java.lang.String getREFLIB()
      Returns the value specified for the REFLIB keyword for this field.
      java.lang.String getTEXT()
      Returns the value specified for the TEXT keyword for this field.
      boolean isDFTCurrent()
      Indicates if the default value for this field is set to one of the SQL special values of CURRENT_DATE, CURRENT_TIME, or CURRENT_TIMESTAMP.
      boolean isDFTNull()
      Indicates if the DFT keyword for this field is set to *NULL.
      void setALIAS(java.lang.String alias)
      Sets the value for the ALIAS keyword for this field.
      void setALWNULL(boolean allowNull)
      Sets the value for the ALWNULL keyword for this field.
      void setCOLHDG(java.lang.String colHdg)
      Sets the value for the COLHDG keyword for this field.
      protected void setDataType(AS400DataType dataType)
      Sets the AS400DataType object describing this field.
      void setDDSName(java.lang.String ddsName)
      Sets the DDS name of this field.
      void setFieldName(java.lang.String fieldName)
      Sets the name of this field.
      void setKeyFieldFunctions(java.lang.String[] keyFunctions)
      Sets the string to be specified for all key field-level keywords for this field.
      void setLayoutAlignment(int layoutAlignment)
      Sets the layout alignment of this field.
      void setLayoutAttributes(int layoutLength, int layoutAlignment)
      Sets the layout length and layout alignment of this field.
      void setLayoutLength(int layoutLength)
      Sets the layout length of this field.
      void setREFFIL(java.lang.String refFil)
      Sets the value to be specified for the REFFIL keyword for this field.
      void setREFFLD(java.lang.String refFld)
      Sets the value to be specified for the REFFLD keyword for this field.
      void setREFFMT(java.lang.String refFmt)
      Sets the value to be specified for the REFFMT keyword for this field.
      void setREFLIB(java.lang.String refLib)
      Sets the value to be specified for the REFLIB keyword for this field.
      void setTEXT(java.lang.String text)
      Sets the value to be specified for the TEXT keyword for this field.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ALIGN_LEFT

        public static final int ALIGN_LEFT
        This is only used for record level writing.
        See Also:
        Constant Field Values
      • ALIGN_RIGHT

        public static final int ALIGN_RIGHT
        This is only used for record level writing.
        See Also:
        Constant Field Values
    • Constructor Detail

      • FieldDescription

        protected FieldDescription()
        Constructs a FieldDescription object.
      • FieldDescription

        protected FieldDescription(AS400DataType dataType,
                        java.lang.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. The layout length will be the length of the field, and the layout alignment will be ALIGN_LEFT.
        Parameters:
        dataType - Describes the field and provides the conversion capability for the contents of the field.
        name - The name of the field.
      • FieldDescription

        protected FieldDescription(AS400DataType dataType,
                        java.lang.String name,
                        java.lang.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. The layout length will be the length of the field, and the layout alignment will be ALIGN_LEFT.
        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.
    • Method Detail

      • getALIAS

        public java.lang.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.
      • getALWNULL

        public boolean getALWNULL()
        Returns the value specified for the ALWNULL keyword for this field.
        Returns:
        The value specified for the ALWNULL (allow null value) keyword. If ALWNULL was not specified for this field, false is returned.
      • getCOLHDG

        public java.lang.String getCOLHDG()
        Returns the value specified for the COLHDG keyword for this field.
        Returns:
        The value specified for the COLHDG (column heading) keyword for this field. If COLHDG was not specified for this field, an empty string is returned. For a description of the format of the 3-part column heading string, refer to setCOLHDG().
      • 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.
      • getDFT

        public java.lang.Object getDFT()
        Returns the value specified for the DFT keyword for this field.
        Returns:
        The value specified for the DFT (default) keyword for this field. If DFT was not specified for this field, null is returned.
      • getDFTCurrentValue

        public java.lang.String getDFTCurrentValue()
        Returns the default value setting based on the current timestamp. If this field has had its default value set by calling setDFTCurrent(), then this method will return the value of the current Date, Time, or Timestamp to be used for that default value; otherwise, it returns null.
        Returns:
        The value being used as the "current" default value for this field. If DFT was not specified for this field, null is returned.
      • getDDSName

        public java.lang.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.
      • getFieldName

        public java.lang.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.
      • getKeyFieldFunctions

        public java.lang.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.
      • getLayoutAlignment

        public int getLayoutAlignment()
        Returns the layout alignment of this field. The layout alignment specifies the location of the data as presented within the layout length of the field. This value is only used in conjunction with line data record writer class, and only if the including record format is of type FIXED_LAYOUT_LENGTH.
        Returns:
        The layout alignment of this field.
      • getLayoutLength

        public int getLayoutLength()
        Returns the layout length of this field. The layout length is the actual character length of the field when written using the line data record writer class. The layout length is only valid if the including record format is of type FIXED_LAYOUT_LENGTH.
        Returns:
        The layout length of this field.
      • getLength

        public int getLength()
        Returns the length of this 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.
      • getREFFIL

        public java.lang.String getREFFIL()
        Returns the value specified for the REFFIL keyword for this field.
        Returns:
        The value specified for the REFFIL (reference file) keyword for this field. If REFFIL was not specified for this field, an empty string is returned.
      • getREFFLD

        public java.lang.String getREFFLD()
        Returns the value specified for the REFFLD keyword for this field.
        Returns:
        The value specified for the REFFLD (reference field) keyword for this field. If REFFLD was not specified for this field, an empty string is returned.
      • getREFFMT

        public java.lang.String getREFFMT()
        Returns the value specified for the REFFMT keyword for this field.
        Returns:
        The value specified for the REFFMT (reference record format) keyword for this field. If REFFMT was not specified for this field, an empty string is returned.
      • getREFLIB

        public java.lang.String getREFLIB()
        Returns the value specified for the REFLIB keyword for this field.
        Returns:
        The value specified for the REFLIB (reference library) keyword for this field. If REFLIB was not specified for this field, an empty string is returned.
      • getTEXT

        public java.lang.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.
      • isDFTCurrent

        public boolean isDFTCurrent()
        Indicates if the default value for this field is set to one of the SQL special values of CURRENT_DATE, CURRENT_TIME, or CURRENT_TIMESTAMP.
        Returns:
        True if the default value is set to one of the above.
      • setALIAS

        public void setALIAS(java.lang.String alias)
        Sets the value for the ALIAS keyword for this field.
        Parameters:
        alias - The alias for this field.
      • setALWNULL

        public void setALWNULL(boolean allowNull)
        Sets the value for the ALWNULL keyword for this field.
        Parameters:
        allowNull - true if a null value is allowed; false otherwise.
      • setCOLHDG

        public void setCOLHDG(java.lang.String colHdg)
        Sets the value for the COLHDG keyword for this field.
        Parameters:
        colHdg - The value for the COLHDG (column heading) 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'";
                             
      • 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.
      • setDDSName

        public void setDDSName(java.lang.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.
      • setFieldName

        public void setFieldName(java.lang.String fieldName)
        Sets the name of this field.
        Parameters:
        fieldName - The name of this field. The fieldName cannot be null.
      • setKeyFieldFunctions

        public void setKeyFieldFunctions(java.lang.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.
      • setLayoutAlignment

        public void setLayoutAlignment(int layoutAlignment)
        Sets the layout alignment of this field. The layout alignment specifies the location of the data as presented within the layout length of the field. This value is only used in conjunction with the line data record writer class, and only if the including record format is of type FIXED_LAYOUT_LENGTH.

        The following special values are valid:

        • ALIGN_LEFT - Left alignment of data within the field layout.
        • ALIGN_RIGHT - Right alignment of data within the field layout.
        Parameters:
        layoutAlignment - The layout alignment of this field.
      • setLayoutAttributes

        public void setLayoutAttributes(int layoutLength,
                               int layoutAlignment)
        Sets the layout length and layout alignment of this field. The layout length is the actual character length of the field when written using the line data record writer class. The layout length must be 50 characters or less. The layout alignment specifies the location of the data as presented within the layout length of the field. These values are only used in conjunction with the line data record writer class, and only if the including record format is of type FIXED_LAYOUT_LENGTH.

        The following special values for the layout alignment are valid:

        • ALIGN_LEFT - Left alignment of data within the field layout.
        • ALIGN_RIGHT - Right alignment of data within the field layout.
        Parameters:
        layoutLength - The layout length of this field.
        layoutAlignment - The layout alignment of this field.
      • setLayoutLength

        public void setLayoutLength(int layoutLength)
        Sets the layout length of this field. The layout length is the actual character length of the field when written using the line data record writer class. The layout length is only valid if the including record format is of type FIXED_LAYOUT_LENGTH. The layout length must be 50 characters or less. NOTE: The layout length does not have to equal the length of the field.
        Parameters:
        layoutLength - The layout length of this field.
      • setREFFIL

        public void setREFFIL(java.lang.String refFil)
        Sets the value to be specified for the REFFIL keyword for this field.
        Parameters:
        refFil - The value for the REFFIL (reference file) keyword for this field.
      • setREFFLD

        public void setREFFLD(java.lang.String refFld)
        Sets the value to be specified for the REFFLD keyword for this field.
        Parameters:
        refFld - The value for the REFFLD (reference field) keyword for this field.
      • setREFFMT

        public void setREFFMT(java.lang.String refFmt)
        Sets the value to be specified for the REFFMT keyword for this field.
        Parameters:
        refFmt - The value for the REFFMT (reference record format) keyword for this field.
      • setREFLIB

        public void setREFLIB(java.lang.String refLib)
        Sets the value to be specified for the REFLIB keyword for this field.
        Parameters:
        refLib - The value for the REFLIB (reference library) keyword for this field.
      • setTEXT

        public void setTEXT(java.lang.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.
      • isDFTNull

        public boolean isDFTNull()
        Indicates if the DFT keyword for this field is set to *NULL.
        Returns:
        True if the DFT keyword is set to *NULL.