Package liquibase.datatype
Class DataTypeFactory
java.lang.Object
liquibase.datatype.DataTypeFactory
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuild 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 DataTypeFactoryGet this factory singletongetTrueBooleanValue(Database database) voidregister(LiquibaseDataType type) Registers an implementation ofLiquibaseDataTypewith both its name and all aliases for the data type as a handler in the factory's registry.static voidreset()Discards the active factory and creates a new singleton instance.voidunregister(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 ofLiquibaseDataTypewith 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- theDatabaseobject from for which the native definition is to be generated- Returns:
- the corresponding Liquibase data type in object form.
-
fromObject
-
from
-
from
-
getTrueBooleanValue
-
getFalseBooleanValue
-