Package adams.data.jooq
Class ScriptedConfigurationGenerator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.jooq.AbstractJOOQConfigurationGenerator
-
- adams.data.jooq.AbstractScriptedJOOQConfigurationGenerator
-
- adams.data.jooq.ScriptedConfigurationGenerator
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.QuickInfoSupporter
,adams.core.scripting.FileBasedScripting
,adams.core.scripting.FileBasedScriptingWithOptions
,adams.core.SizeOfHandler
,adams.db.DatabaseConnectionHandler
,adams.db.DatabaseConnectionProvider
,adams.db.DatabaseConnectionUser
,Serializable
public class ScriptedConfigurationGenerator extends AbstractScriptedJOOQConfigurationGenerator
A configuration generator that uses any scripting handler for generating the configuration with a script located in the specified file.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-output <adams.core.io.PlaceholderFile> (property: output) The file to store the XML configuration in. default: ${CWD}
-provider <adams.data.jooq.AbstractJOOQCodeGeneratorProvider> (property: provider) The provider for the jOOQ code generator to use. default: adams.data.jooq.JavaCodeGeneratorProvider
-script <adams.core.io.PlaceholderFile> (property: scriptFile) The script file to load and execute. default: ${CWD}
-options <java.lang.String> (property: scriptOptions) The options for the script; must consist of 'key=value' pairs separated by blanks; the value of 'key' can be accessed via the 'getAdditionalOptions ().getXYZ("key")' method in the script actor. default:
-handler <adams.core.scripting.AbstractScriptingHandler> (property: handler) The handler to use for scripting. default: adams.core.scripting.Dummy
- Version:
- $Revision: 8704 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractJOOQConfigurationGenerator
m_GeneratorObject
the loaded script object.protected adams.core.scripting.AbstractScriptingHandler
m_Handler
the scripting handler to use.-
Fields inherited from class adams.data.jooq.AbstractScriptedJOOQConfigurationGenerator
m_ScriptFile, m_ScriptObject, m_ScriptOptions
-
Fields inherited from class adams.data.jooq.AbstractJOOQConfigurationGenerator
m_DatabaseConnection, m_Output, m_Provider
-
-
Constructor Summary
Constructors Constructor Description ScriptedConfigurationGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
check()
The default implementation only checks whether there is any data set.protected String
checkScriptObject()
Checks the script object.void
defineOptions()
Adds options to the internal list of options.void
destroy()
Frees up memory in a "destructive" non-reversible way.protected String
doGenerate()
Does nothingadams.core.io.PlaceholderFile
generate()
Generates the XML configuration.adams.core.scripting.AbstractScriptingHandler
getHandler()
Gets the handler to use for scripting.String
globalInfo()
Returns a string describing the object.String
handlerTipText()
Returns the tip text for this property.protected String
loadScriptObject()
Loads the scripts object and sets its options.String
scriptOptionsTipText()
Returns the tip text for this property.void
setHandler(adams.core.scripting.AbstractScriptingHandler value)
Sets the handler to use for scripting.-
Methods inherited from class adams.data.jooq.AbstractScriptedJOOQConfigurationGenerator
getScriptFile, getScriptOptions, initScriptObject, reset, scriptFileTipText, setScriptFile, setScriptOptions
-
Methods inherited from class adams.data.jooq.AbstractJOOQConfigurationGenerator
getDatabaseConnection, getOutput, getProvider, getQuickInfo, initialize, outputTipText, providerTipText, setDatabaseConnection, setOutput, setProvider
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_GeneratorObject
protected transient AbstractJOOQConfigurationGenerator m_GeneratorObject
the loaded script object.
-
m_Handler
protected adams.core.scripting.AbstractScriptingHandler m_Handler
the scripting handler to use.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.core.option.AbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classAbstractScriptedJOOQConfigurationGenerator
-
scriptOptionsTipText
public String scriptOptionsTipText()
Returns the tip text for this property.- Specified by:
scriptOptionsTipText
in interfaceadams.core.scripting.FileBasedScriptingWithOptions
- Overrides:
scriptOptionsTipText
in classAbstractScriptedJOOQConfigurationGenerator
- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setHandler
public void setHandler(adams.core.scripting.AbstractScriptingHandler value)
Sets the handler to use for scripting.- Parameters:
value
- the handler
-
getHandler
public adams.core.scripting.AbstractScriptingHandler getHandler()
Gets the handler to use for scripting.- Returns:
- the handler
-
handlerTipText
public String handlerTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
loadScriptObject
protected String loadScriptObject()
Loads the scripts object and sets its options.- Specified by:
loadScriptObject
in classAbstractScriptedJOOQConfigurationGenerator
- Returns:
- null if OK, otherwise the error message
-
checkScriptObject
protected String checkScriptObject()
Checks the script object.- Specified by:
checkScriptObject
in classAbstractScriptedJOOQConfigurationGenerator
- Returns:
- null if OK, otherwise the error message
-
check
protected void check()
The default implementation only checks whether there is any data set.- Overrides:
check
in classAbstractScriptedJOOQConfigurationGenerator
- Parameters:
data
- the data to filter
-
doGenerate
protected String doGenerate() throws Exception
Does nothing- Specified by:
doGenerate
in classAbstractJOOQConfigurationGenerator
- Returns:
- always null
- Throws:
Exception
- never
-
generate
public adams.core.io.PlaceholderFile generate()
Generates the XML configuration.- Overrides:
generate
in classAbstractJOOQConfigurationGenerator
- Returns:
- the generated XML file or null in case of an error
-
destroy
public void destroy()
Frees up memory in a "destructive" non-reversible way.- Specified by:
destroy
in interfaceadams.core.Destroyable
- Overrides:
destroy
in classAbstractScriptedJOOQConfigurationGenerator
-
-