liquibase.change.custom
Class CustomChangeWrapper

java.lang.Object
  extended by liquibase.change.AbstractChange
      extended by liquibase.change.custom.CustomChangeWrapper
All Implemented Interfaces:
Change

public class CustomChangeWrapper
extends AbstractChange

Adapts CustomChange implementations to the standard change system used by Liquibase. Custom change implementations should implement CustomSqlChange or CustomTaskChange

See Also:
CustomSqlChange, CustomTaskChange

Constructor Summary
CustomChangeWrapper()
           
 
Method Summary
 SqlStatement[] generateRollbackStatements(Database database)
          Generates the SQL statements required to roll back the change
 SqlStatement[] generateStatements(Database database)
          Generates the SQL statements required to run the change
 ClassLoader getClassLoader()
           
 String getClassName()
           
 String getConfirmationMessage()
           
 CustomChange getCustomChange()
           
 SortedSet<String> getParams()
           
 Map<String,String> getParamValues()
           
 void setClass(String className)
           
 void setClassLoader(ClassLoader classLoader)
           
 void setParam(String name, String value)
           
 boolean supportsRollback(Database database)
          Can this change be rolled back
 ValidationErrors validate(Database database)
           
 Warnings warn(Database database)
           
 
Methods inherited from class liquibase.change.AbstractChange
createInverses, generateCheckSum, getAffectedDatabaseObjects, getChangeLogParameters, getChangeMetaData, getChangeSet, getResourceAccessor, init, requiresUpdatedDatabaseMetadata, setChangeLogParameters, setChangeSet, setPriority, setResourceAccessor, supports
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomChangeWrapper

public CustomChangeWrapper()
Method Detail

getCustomChange

public CustomChange getCustomChange()

getClassLoader

public ClassLoader getClassLoader()

setClassLoader

public void setClassLoader(ClassLoader classLoader)

setClass

public void setClass(String className)
              throws CustomChangeException
Throws:
CustomChangeException

getClassName

public String getClassName()

setParam

public void setParam(String name,
                     String value)

getParams

public SortedSet<String> getParams()

getParamValues

public Map<String,String> getParamValues()

validate

public ValidationErrors validate(Database database)
Specified by:
validate in interface Change
Overrides:
validate in class AbstractChange

warn

public Warnings warn(Database database)
Specified by:
warn in interface Change
Overrides:
warn in class AbstractChange

generateStatements

public SqlStatement[] generateStatements(Database database)
Description copied from interface: Change
Generates the SQL statements required to run the change

Parameters:
database - databasethe target Database associated to this change's statements
Returns:
an array of Strings with the statements

generateRollbackStatements

public SqlStatement[] generateRollbackStatements(Database database)
                                          throws UnsupportedChangeException,
                                                 RollbackImpossibleException
Description copied from interface: Change
Generates the SQL statements required to roll back the change

Specified by:
generateRollbackStatements in interface Change
Overrides:
generateRollbackStatements in class AbstractChange
Parameters:
database - database databasethe target Database associated to this change's rollback statements
Returns:
an array of Strings with the rollback statements
Throws:
UnsupportedChangeException - if this change is not supported by the Database passed as argument
RollbackImpossibleException - if rollback is not supported for this change
See Also:
Change.generateRollbackStatements(liquibase.database.Database)

supportsRollback

public boolean supportsRollback(Database database)
Description copied from interface: Change
Can this change be rolled back

Specified by:
supportsRollback in interface Change
Overrides:
supportsRollback in class AbstractChange
Returns:
true if rollback is supported, false otherwise
See Also:
Change.supportsRollback(liquibase.database.Database)

getConfirmationMessage

public String getConfirmationMessage()
Returns:
Confirmation message to be displayed after the change is executed


Copyright © 2012 Liquibase.org. All Rights Reserved.