org.prorefactor.treeparser
Class DataType

java.lang.Object
  extended by org.prorefactor.treeparser.DataType
All Implemented Interfaces:
Xferable

public class DataType
extends java.lang.Object
implements Xferable

One static instance of DataType is created for each data type in the 4GL. You can access each of those through this class's public static final variables. This class was created just so that we could look up, and store, an object instead of a String or int to represent data type. For example, we'll be adding datatype support into Field and schemaLoad next.


Field Summary
static DataType BIGINT
           
static DataType BLOB
           
static DataType BYTE
           
static DataType CHARACTER
           
static DataType CLASS
           
static DataType CLOB
           
static DataType COMHANDLE
           
static DataType DATE
           
static DataType DATETIME
           
static DataType DATETIMETZ
           
static DataType DECIMAL
           
static DataType DOUBLE
           
static DataType FIXCHAR
           
static DataType FLOAT
           
static DataType HANDLE
           
static DataType INT64
           
static DataType INTEGER
           
static DataType LOGICAL
           
static DataType LONG
           
static DataType LONGCHAR
           
static DataType MEMPTR
           
static DataType NUMERIC
           
static DataType RAW
           
static DataType RECID
           
static DataType ROWID
           
static DataType SHORT
           
static DataType TIME
           
static DataType TIMESTAMP
           
static DataType TYPE_NAME
           
static DataType UNSIGNEDSHORT
           
static DataType WIDGETHANDLE
           
 
Constructor Summary
DataType()
          Only to be used for persistence/serialization.
 
Method Summary
static DataType getDataType(int tokenType)
          Get the DataType object for an integer token type.
static DataType getDataType(java.lang.String progressCapsName)
          Get the DataType object for a String "progress data type name", ex: "COM-HANDLE".
 java.lang.String getProgressName()
          The progress name for the data type is all caps, ex: "COM-HANDLE"
 int getTokenType()
          Returns the Proparse integer token type, ex: TokenTypes.COMHANDLE
 java.lang.String toString()
          Same as getProgressName.
 void writeXferBytes(DataXferStream out)
          Implement Xferable.
 void writeXferSchema(DataXferStream out)
          Implement Xferable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BIGINT

public static final DataType BIGINT

BLOB

public static final DataType BLOB

BYTE

public static final DataType BYTE

CHARACTER

public static final DataType CHARACTER

CLASS

public static final DataType CLASS

CLOB

public static final DataType CLOB

COMHANDLE

public static final DataType COMHANDLE

DATE

public static final DataType DATE

DATETIME

public static final DataType DATETIME

DATETIMETZ

public static final DataType DATETIMETZ

DECIMAL

public static final DataType DECIMAL

DOUBLE

public static final DataType DOUBLE

FIXCHAR

public static final DataType FIXCHAR

FLOAT

public static final DataType FLOAT

HANDLE

public static final DataType HANDLE

INTEGER

public static final DataType INTEGER

INT64

public static final DataType INT64

LONG

public static final DataType LONG

LONGCHAR

public static final DataType LONGCHAR

LOGICAL

public static final DataType LOGICAL

MEMPTR

public static final DataType MEMPTR

NUMERIC

public static final DataType NUMERIC

RAW

public static final DataType RAW

RECID

public static final DataType RECID

ROWID

public static final DataType ROWID

SHORT

public static final DataType SHORT

TIME

public static final DataType TIME

TIMESTAMP

public static final DataType TIMESTAMP

TYPE_NAME

public static final DataType TYPE_NAME

UNSIGNEDSHORT

public static final DataType UNSIGNEDSHORT

WIDGETHANDLE

public static final DataType WIDGETHANDLE
Constructor Detail

DataType

public DataType()
Only to be used for persistence/serialization.

Method Detail

getDataType

public static DataType getDataType(int tokenType)
Get the DataType object for an integer token type. This can return null - when you use this function, adding a check with assert or throw might be appropriate.


getDataType

public static DataType getDataType(java.lang.String progressCapsName)
Get the DataType object for a String "progress data type name", ex: "COM-HANDLE". Requires all caps characters, not abbreviated. This can return null - when you use this function, adding a check with assert or throw might be appropriate.


getProgressName

public java.lang.String getProgressName()
The progress name for the data type is all caps, ex: "COM-HANDLE"


getTokenType

public int getTokenType()
Returns the Proparse integer token type, ex: TokenTypes.COMHANDLE


toString

public java.lang.String toString()
Same as getProgressName.

Overrides:
toString in class java.lang.Object
See Also:
getProgressName()

writeXferBytes

public void writeXferBytes(DataXferStream out)
                    throws java.io.IOException
Implement Xferable.

Specified by:
writeXferBytes in interface Xferable
Throws:
java.io.IOException

writeXferSchema

public void writeXferSchema(DataXferStream out)
                     throws java.io.IOException
Implement Xferable.

Specified by:
writeXferSchema in interface Xferable
Throws:
java.io.IOException


Copyright © 2008 Joanju Software. All Rights Reserved.