Package adams.tools
Class DropTables
-
- All Implemented Interfaces:
CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,Stoppable,StoppableWithFeedback,DatabaseConnectionHandler,DatabaseConnectionProvider,DatabaseConnectionUser,Serializable,Comparable
public class DropTables extends AbstractDatabaseTool
Drops all tables that match a regular expression (matching sense can be inverted).
Valid options are:
-D (property: debug) If set to true, scheme may output additional info to the console.
-regexp <java.lang.String> (property: regExp) The regular expression used for matching the table names. default: .*
-invert (property: invert) If set to true, then the matching sense is inverted.
- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_Invertwhether to invert the matching sense.protected BaseRegExpm_RegExpthe regular expression to match.-
Fields inherited from class adams.tools.AbstractDatabaseTool
m_dbc
-
Fields inherited from class adams.tools.AbstractTool
m_Stopped
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description DropTables()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected voiddoRun()Attempt to load the file and save to db.protected AbstractDatabaseConnectiongetDefaultDatabaseConnection()Returns the default database connection.booleangetInvert()Returns whether to invert the matching sense.BaseRegExpgetRegExp()Returns the regular expression to match the table names against.StringglobalInfo()Returns a string describing the object.StringinvertTipText()Returns the tip text for this property.StringregExpTipText()Returns the tip text for this property.voidsetInvert(boolean value)Sets whether to invert the matching sense.voidsetRegExp(BaseRegExp value)Sets the regular expression to match the table names against.-
Methods inherited from class adams.tools.AbstractDatabaseTool
cleanUp, getDatabaseConnection, initialize, setDatabaseConnection
-
Methods inherited from class adams.tools.AbstractTool
compareTo, destroy, equals, forCommandLine, forName, getTools, isStopped, postRun, preRun, run, runTool, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_RegExp
protected BaseRegExp m_RegExp
the regular expression to match.
-
m_Invert
protected boolean m_Invert
whether to invert the matching sense.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
getDefaultDatabaseConnection
protected AbstractDatabaseConnection getDefaultDatabaseConnection()
Returns the default database connection.- Specified by:
getDefaultDatabaseConnectionin classAbstractDatabaseTool- Returns:
- the database connection
-
setRegExp
public void setRegExp(BaseRegExp value)
Sets the regular expression to match the table names against.- Parameters:
value- the regular expression
-
getRegExp
public BaseRegExp getRegExp()
Returns the regular expression to match the table names against.- Returns:
- the regular expression
-
regExpTipText
public String regExpTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setInvert
public void setInvert(boolean value)
Sets whether to invert the matching sense.- Parameters:
value- true if inverting matching sense
-
getInvert
public boolean getInvert()
Returns whether to invert the matching sense.- Returns:
- true if matching sense is inverted
-
invertTipText
public String invertTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
doRun
protected void doRun()
Attempt to load the file and save to db. Exit java upon failure- Specified by:
doRunin classAbstractTool
-
-