com.ibm.as400.access
Class DBCSOnlyFieldDescription
- java.lang.Object
-
- com.ibm.as400.access.FieldDescription
-
- com.ibm.as400.access.DBCSOnlyFieldDescription
-
- All Implemented Interfaces:
- VariableLengthFieldDescription, java.io.Serializable
public class DBCSOnlyFieldDescription extends FieldDescription implements VariableLengthFieldDescription, java.io.Serializable
The DBCSOnlyFieldDescription class represents the description of the data in a DBCS-only field. It allows:- The user to describe a DBCS-only field to the RecordFormat object.
- The RecordFormat object to describe a DBCS-only field to the user.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.ibm.as400.access.FieldDescription
ALIGN_LEFT, ALIGN_RIGHT
-
-
Constructor Summary
Constructors Constructor and Description DBCSOnlyFieldDescription()
Constructs a DBCSOnlyFieldDescription object.DBCSOnlyFieldDescription(AS400Text dataType, java.lang.String name)
Constructs a DBCSOnlyFieldDescription object.DBCSOnlyFieldDescription(AS400Text dataType, java.lang.String name, java.lang.String ddsName)
Constructs a DBCSOnlyFieldDescription object.
-
Method Summary
Methods Modifier and Type Method and Description java.lang.String
getCCSID()
Returns the value specified for the CCSID keyword for this field.int
getVARLEN()
Returns the value specified for the VARLEN keyword for this field.boolean
isVariableLength()
Indicates if the field is a variable-length field.void
setCCSID(java.lang.String ccsid)
Sets the value for the CCSID keyword for this field.void
setDataType(AS400Text dataType)
Sets the AS400DataType object describing this field.void
setDFT(java.lang.String defaultValue)
Sets the value for the DFT keyword for this field.void
setDFTNull()
Sets the value for the DFT keyword to be *NULL for this field.void
setVariableLength(boolean value)
Sets the value that indicates if the field is a variable-length field.void
setVARLEN(int varLen)
Sets the value to specify for the VARLEN keyword for this field.-
Methods inherited from class com.ibm.as400.access.FieldDescription
getALIAS, getALWNULL, getCOLHDG, getDataType, getDDSName, getDFT, getDFTCurrentValue, getFieldName, getKeyFieldFunctions, getLayoutAlignment, getLayoutLength, getLength, getREFFIL, getREFFLD, getREFFMT, getREFLIB, getTEXT, isDFTCurrent, isDFTNull, setALIAS, setALWNULL, setCOLHDG, setDataType, setDDSName, setFieldName, setKeyFieldFunctions, setLayoutAlignment, setLayoutAttributes, setLayoutLength, setREFFIL, setREFFLD, setREFFMT, setREFLIB, setTEXT
-
-
-
-
Constructor Detail
-
DBCSOnlyFieldDescription
public DBCSOnlyFieldDescription()
Constructs a DBCSOnlyFieldDescription object.
-
DBCSOnlyFieldDescription
public DBCSOnlyFieldDescription(AS400Text dataType, java.lang.String name)
Constructs a DBCSOnlyFieldDescription object. It uses the specified data type and name of the field. The length of the field will be the length specified on the AS400Text object.- Parameters:
dataType
- Describes the field and provides the conversion capability for the contents of the field.name
- The name of the field.
-
DBCSOnlyFieldDescription
public DBCSOnlyFieldDescription(AS400Text dataType, java.lang.String name, java.lang.String ddsName)
Constructs a DBCSOnlyFieldDescription 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 AS400Text 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.
-
-
Method Detail
-
getCCSID
public java.lang.String getCCSID()
Returns the value specified for the CCSID keyword for this field.- Returns:
- The value specified for the CCSID keyword for this field. If CCSID was not specified for this field, an empty string is returned.
-
getVARLEN
public int getVARLEN()
Returns the value specified for the VARLEN keyword for this field.- Returns:
- The value specified for VARLEN for this field. If VARLEN was not specified for this field, 0 is returned.
-
isVariableLength
public boolean isVariableLength()
Indicates if the field is a variable-length field.- Specified by:
isVariableLength
in interfaceVariableLengthFieldDescription
- Returns:
- true if the field is a variable-length field; false otherwise.
-
setCCSID
public void setCCSID(java.lang.String ccsid)
Sets the value for the CCSID keyword for this field.- Parameters:
ccsid
- The value for the CCSID keyword for this field.
-
setDataType
public void setDataType(AS400Text dataType)
Sets the AS400DataType object describing this field.- Parameters:
dataType
- The AS400DataType that describes this field. The dataType cannot be null.
-
setDFT
public void setDFT(java.lang.String defaultValue)
Sets the value for the DFT keyword for this field.- Parameters:
defaultValue
- The default value for this field. The defaultValue cannot be null. To set a default value of *NULL, use the setDFTNull() method.
-
setDFTNull
public void setDFTNull()
Sets the value for the DFT keyword to be *NULL for this field. Calling this method will replace the DFT keyword that was previously set on a call to setDFT(). Note: This field must also have its ALWNULL keyword set to true to prevent DDS errors.
-
setVariableLength
public void setVariableLength(boolean value)
Sets the value that indicates if the field is a variable-length field.- Specified by:
setVariableLength
in interfaceVariableLengthFieldDescription
- Parameters:
value
- true if the field is a variable-length field; false otherwise.
-
setVARLEN
public void setVARLEN(int varLen)
Sets the value to specify for the VARLEN keyword for this field.- Parameters:
varLen
- The value to specify for the VARLEN keyword for this field. The varLen cannot be less than zero.
-
-