public class DataTypeFactory extends Object
Modifier | Constructor and Description |
---|---|
protected |
DataTypeFactory()
Build the factory registry from all classes in the classpath that implement
LiquibaseDataType |
Modifier and Type | Method and Description |
---|---|
LiquibaseDataType |
from(DatabaseDataType type,
Database database) |
LiquibaseDataType |
from(DataType type,
Database database) |
LiquibaseDataType |
fromDescription(String dataTypeDefinition,
Database database)
Translates a column data type definition (e.g.
|
LiquibaseDataType |
fromObject(Object object,
Database database) |
String |
getFalseBooleanValue(Database database) |
static DataTypeFactory |
getInstance()
Get this factory singleton
|
String |
getTrueBooleanValue(Database database) |
void |
register(Class<? extends LiquibaseDataType> dataTypeClass)
Registers an implementation of
LiquibaseDataType 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
|
protected DataTypeFactory()
LiquibaseDataType
public static DataTypeFactory getInstance()
public static void reset()
public void register(Class<? extends LiquibaseDataType> dataTypeClass)
LiquibaseDataType
with both its name and all aliases for the data type
as a handler in the factory's registry. Classes implement the LiquibaseDataType.getPriority()
, which will
cause the class with the highest priority to become the primary handler for the data type.dataTypeClass
- the implementation to registerpublic void unregister(String name)
name
- public LiquibaseDataType fromDescription(String dataTypeDefinition, Database database)
dataTypeDefinition
- the definition from the changeSetdatabase
- the Database
object from for which the native definition is to be generatedpublic LiquibaseDataType fromObject(Object object, Database database)
public LiquibaseDataType from(DataType type, Database database)
public LiquibaseDataType from(DatabaseDataType type, Database database)
Copyright © 2019 Liquibase.org. All rights reserved.