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

Field Summary
 
Fields inherited from class liquibase.change.AbstractChange
log
 
Constructor Summary
CustomChangeWrapper()
           
 
Method Summary
 boolean canRollBack()
          Can this change be rolled back
 org.w3c.dom.Element createNode(org.w3c.dom.Document currentChangeLogDOM)
          Creates an XML element (of type Node) of the change object, and adds it to the Document object passed as argument
 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
 java.util.Set<DatabaseObject> getAffectedDatabaseObjects()
           
 java.lang.ClassLoader getClassLoader()
           
 java.lang.String getConfirmationMessage()
          Confirmation message to be displayed after the change is executed
 liquibase.change.custom.CustomChange getCustomChange()
           
 void setClass(java.lang.String className)
           
 void setClassLoader(java.lang.ClassLoader classLoader)
           
 void setParam(java.lang.String name, java.lang.String value)
           
 void validate(Database database)
           
 
Methods inherited from class liquibase.change.AbstractChange
createInverses, executeRollbackStatements, executeStatements, getChangeName, getChangeSet, getFileOpener, getMD5Sum, getTagName, saveRollbackStatement, saveStatements, setChangeSet, setFileOpener, setUp
 
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 liquibase.change.custom.CustomChange getCustomChange()

getClassLoader

public java.lang.ClassLoader getClassLoader()

setClassLoader

public void setClassLoader(java.lang.ClassLoader classLoader)

setClass

public void setClass(java.lang.String className)
              throws CustomChangeException
Throws:
CustomChangeException

setParam

public void setParam(java.lang.String name,
                     java.lang.String value)

validate

public void validate(Database database)
              throws InvalidChangeDefinitionException
Throws:
InvalidChangeDefinitionException

generateStatements

public SqlStatement[] generateStatements(Database database)
                                  throws UnsupportedChangeException
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
Throws:
UnsupportedChangeException - if this change is not supported by the Database passed as argument

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)

canRollBack

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

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

getConfirmationMessage

public java.lang.String getConfirmationMessage()
Description copied from interface: Change
Confirmation message to be displayed after the change is executed

Returns:
a String containing the message after the change is executed

createNode

public org.w3c.dom.Element createNode(org.w3c.dom.Document currentChangeLogDOM)
Description copied from interface: Change
Creates an XML element (of type Node) of the change object, and adds it to the Document object passed as argument

Parameters:
currentChangeLogDOM - the current Document where this element is being added
Returns:
the Node object created

getAffectedDatabaseObjects

public java.util.Set<DatabaseObject> getAffectedDatabaseObjects()