## org.eclipse.datatools.sqltools.core
Class DataTypeProvider

    java.lang.Object
      org.eclipse.datatools.sqltools.core.DataTypeProvider

    public class DataTypeProvider

extends java.lang.Object

Provides data types for given context

Author:
  Dafan Yang

Field Summary
`static int` `ALL`
`static int` `DB_SPECIFIC_CONTEXT_BASE`
`static int` `INDEX_COLUMN`
`static java.lang.String` `LENGTH_FEATURE`
`static java.lang.String` `NAME_FEATURE`
`static int` `PARAMETER`
`static java.lang.String` `PRECISION_FEATURE`
`static int` `PREDEFINED`
`static int` `RETURN_VALUE`
`static java.lang.String` `SCALE_FEATURE`
`static int` `TABLE_COLUMN`
`static int` `UDT`
`static int` `VARIABLE`

Constructor Summary
`DataTypeProvider()`

Method Summary
`DataType[]` `getAvailableDataTypes(int context, Schema schema, DatabaseIdentifier databaseIdentifier)` Returns the available data types of the given context. Subclass may need to fine-tune this method, for example, for paramter context, all the large data types wont be returned by default, but this is not always the case for all databases.
`java.lang.String[]` `getAvailableDataTypesDisplayString(int context, Schema schema, DatabaseIdentifier databaseIdentifier)` Returns the display string of the available datatypes of the given context.
`DataType` `getDataType(java.lang.String typeString, Schema schema, DatabaseIdentifier databaseIdentifier)`
`DataType` `getDataType(java.lang.String typeString, Schema schema, int context, DatabaseIdentifier databaseIdentifier)` Returns the data type instance given the data type string.
`java.lang.String` `getDataTypeString(DataType dataType, boolean qualified)` Returns the data type string given the data type
`PredefinedDataTypeDefinition[]` `getPredefinedDataTypeDefinitions()` Returns the predefined data type definitions of this database
`java.lang.String[]` `getPredefinedDataTypeNames()` Returns name of predefined data types

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### LENGTH_FEATURE

    public static final java.lang.String LENGTH_FEATURE

See Also:
  Constant Field Values

### PRECISION_FEATURE

    public static final java.lang.String PRECISION_FEATURE

See Also:
  Constant Field Values

### SCALE_FEATURE

    public static final java.lang.String SCALE_FEATURE

See Also:
  Constant Field Values

### NAME_FEATURE

    public static final java.lang.String NAME_FEATURE

See Also:
  Constant Field Values

### ALL

    public static final int ALL

See Also:
  Constant Field Values

### PREDEFINED

    public static final int PREDEFINED

See Also:
  Constant Field Values

### UDT

    public static final int UDT

See Also:
  Constant Field Values

### TABLE_COLUMN

    public static final int TABLE_COLUMN

See Also:
  Constant Field Values

### PARAMETER

    public static final int PARAMETER

See Also:
  Constant Field Values

### VARIABLE

    public static final int VARIABLE

See Also:
  Constant Field Values

### RETURN_VALUE

    public static final int RETURN_VALUE

See Also:
  Constant Field Values

### INDEX_COLUMN

    public static final int INDEX_COLUMN

See Also:
  Constant Field Values

### DB_SPECIFIC_CONTEXT_BASE

    public static final int DB_SPECIFIC_CONTEXT_BASE

See Also:
  Constant Field Values

Constructor Detail

### DataTypeProvider

    public DataTypeProvider()

Method Detail

### getAvailableDataTypes

    public DataType[] getAvailableDataTypes(int context,
                                            Schema schema,
                                            DatabaseIdentifier databaseIdentifier)

  Returns the available data types of the given context.
  Subclass may need to fine-tune this method, for example, for paramter context, all the large data types wont be returned by default, but this is not always the case for all databases.

  Parameters:
    `context` - the context in which the data types will be used
    `schema` - a schema object thru. which the UDT can be obtained
  See Also:
    `ALL`, `PREDEFINED`, `UDT`, `TABLE_COLUMN`, `PARAMETER`, `VARIABLE`, `RETURN_VALUE`, `INDEX_COLUMN`

### getAvailableDataTypesDisplayString

    public java.lang.String[] getAvailableDataTypesDisplayString(int context,
                                                                 Schema schema,
                                                                 DatabaseIdentifier databaseIdentifier)

  Returns the display string of the available datatypes of the given context.

  Parameters:
    `context` - the context in which the data types will be used
    `schema` - a schema object thru. which the UDT can be obtained
  Returns:

### getDataType

    public DataType getDataType(java.lang.String typeString,
                                Schema schema,
                                DatabaseIdentifier databaseIdentifier)

### getDataType

    public DataType getDataType(java.lang.String typeString,
                                Schema schema,
                                int context,
                                DatabaseIdentifier databaseIdentifier)

  Returns the data type instance given the data type string. If the typeString is invalid, returns null.

  Parameters:
    `typeString` - the string of the data type
    `schema` -
  Returns:
    a schema object thru. which the UDT can be obtained

### getDataTypeString

    public java.lang.String getDataTypeString(DataType dataType,
                                              boolean qualified)

  Returns the data type string given the data type

  Parameters:
    `dataType` - the data type object
  Returns:

### getPredefinedDataTypeDefinitions

    public PredefinedDataTypeDefinition[] getPredefinedDataTypeDefinitions()

  Returns the predefined data type definitions of this database

  Returns:

### getPredefinedDataTypeNames

    public java.lang.String[] getPredefinedDataTypeNames()

  Returns name of predefined data types

  Returns:

Copyright © 2006 -- 2008 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.