Package liquibase.datatype
Class DataTypeFactory
java.lang.Object
liquibase.datatype.DataTypeFactory
-
Constructor Summary
ModifierConstructorDescriptionprotected
Build the factory registry from all classes in the classpath that implementLiquibaseDataType
-
Method Summary
Modifier and TypeMethodDescriptionfrom
(DatabaseDataType type, Database database) fromDescription
(String dataTypeDefinition, Database database) Translates a column data type definition (e.g. varchar(255), java.sql.Types.NVARCHAR(10), VARCHAR2(255 BYTE)... ) into a normalized data type in object form.fromObject
(Object object, Database database) getFalseBooleanValue
(Database database) static DataTypeFactory
Get this factory singletongetTrueBooleanValue
(Database database) void
register
(LiquibaseDataType type) Registers an implementation ofLiquibaseDataType
with both its name and all aliases for the data type as a handler in the factory's registry.static void
reset()
Discards the active factory and creates a new singleton instance.void
unregister
(String name) Remove
-
Constructor Details
-
DataTypeFactory
protected DataTypeFactory()Build the factory registry from all classes in the classpath that implementLiquibaseDataType
-
-
Method Details
-
getInstance
Get this factory singleton- Returns:
- a reference to this factory
-
reset
public static void reset()Discards the active factory and creates a new singleton instance. -
register
Registers an implementation ofLiquibaseDataType
with both its name and all aliases for the data type as a handler in the factory's registry. Classes implement theLiquibaseDataType.getPriority()
, which will cause the class with the highest priority to become the primary handler for the data type.- Parameters:
type
- the implementation to register
-
unregister
Remove- Parameters:
name
-
-
fromDescription
Translates a column data type definition (e.g. varchar(255), java.sql.Types.NVARCHAR(10), VARCHAR2(255 BYTE)... ) into a normalized data type in object form. Note that, due to variety of allowed ways to specify a data type (SQL-Standard, Java type, native RDBMS type...), the dataTypeDefinition we receive for processing may already be the native type for the target RDBMS.- Parameters:
dataTypeDefinition
- the definition from the changeSetdatabase
- theDatabase
object from for which the native definition is to be generated- Returns:
- the corresponding Liquibase data type in object form.
-
fromObject
-
from
-
from
-
getTrueBooleanValue
-
getFalseBooleanValue
-