Package adams.flow.transformer
Class AbstractDataContainerDbReader<T extends DataContainer>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.core.AbstractActor
-
- adams.flow.transformer.AbstractTransformer
-
- adams.flow.transformer.AbstractDbTransformer
-
- adams.flow.transformer.AbstractDataContainerDbReader<T>
-
- Type Parameters:
T
- the type of data to load from the database
- All Implemented Interfaces:
AdditionalInformationHandler
,CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LenientModeSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<Actor>
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,VariablesInspectionHandler
,DatabaseConnectionUser
,VariableChangeListener
,Actor
,ErrorHandler
,InputConsumer
,OutputProducer
,DataContainerDbReader<T>
,Serializable
,Comparable
public abstract class AbstractDataContainerDbReader<T extends DataContainer> extends AbstractDbTransformer implements DataContainerDbReader<T>, LenientModeSupporter
Ancestor for transformers that read containers from the database.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_Lenient
whether to ignore not finding any IDs.protected AbstractDataContainerPostProcessor
m_PostProcessor
the post-processor to apply to the data.protected boolean
m_Raw
whether to return the raw data or not.-
Fields inherited from class adams.flow.transformer.AbstractDbTransformer
m_DatabaseConnection
-
Fields inherited from class adams.flow.transformer.AbstractTransformer
BACKUP_INPUT, BACKUP_OUTPUT, m_InputToken, m_OutputToken
-
Fields inherited from class adams.flow.core.AbstractActor
m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_Executing, m_ExecutionListeningSupporter, m_FullName, m_LoggingPrefix, m_Name, m_Parent, m_ScopeHandler, m_Self, m_Silent, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.flow.core.Actor
FILE_EXTENSION, FILE_EXTENSION_GZ
-
-
Constructor Summary
Constructors Constructor Description AbstractDataContainerDbReader()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Class[]
accepts()
Returns the class that the consumer accepts.void
defineOptions()
Adds options to the internal list of options.abstract Class[]
generates()
Returns the class of objects that it generates.boolean
getLenient()
Returns whether to ignore IDs that weren't found (warning rather than error).AbstractDataContainerPostProcessor
getPostProcessor()
Returns the post-processor in use.boolean
getRaw()
Returns whether to return the raw data or not (only FilteredDataProviders).String
lenientTipText()
Returns the tip text for this property.String
postProcessorTipText()
Returns the tip text for this property.protected String
queryDatabase()
Executes the flow item.String
rawTipText()
Returns the tip text for this property.void
setLenient(boolean value)
Sets whether to ignore IDs that weren't found (warning rather than error).void
setPostProcessor(AbstractDataContainerPostProcessor value)
Sets the post-processor to apply to the data.void
setRaw(boolean value)
Sets whether to return the raw data or not (only FilteredDataProviders).-
Methods inherited from class adams.flow.transformer.AbstractDbTransformer
doExecute, getDatabaseConnection, getDefaultDatabaseConnection, initialize, setUpDatabaseConnection, wrapUp
-
Methods inherited from class adams.flow.transformer.AbstractTransformer
backupState, currentInput, execute, hasInput, hasPendingOutput, input, output, postExecute, restoreState
-
Methods inherited from class adams.flow.core.AbstractActor
annotationsTipText, canInspectOptions, canPerformSetUpCheck, cleanUp, compareTo, configureLogger, destroy, equals, finalUpdateVariables, findVariables, findVariables, forceVariables, forCommandLine, forName, forName, getAdditionalInformation, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getQuickInfo, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, handleException, hasErrorHandler, hasStopMessage, index, isBackedUp, isExecuted, isExecuting, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, performVariableChecks, preExecute, pruneBackup, pruneBackup, reset, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setUp, setVariables, shallowCopy, shallowCopy, silentTipText, sizeOf, skipTipText, stopExecution, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables, variableChanged
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.flow.core.Actor
cleanUp, compareTo, destroy, equals, execute, findVariables, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getQuickInfo, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, hasErrorHandler, hasStopMessage, index, isExecuted, isFinished, isHeadless, isStopped, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setUp, setVariables, shallowCopy, shallowCopy, sizeOf, stopExecution, stopExecution, toCommandLine, variableChanged, wrapUp
-
Methods inherited from interface adams.core.AdditionalInformationHandler
getAdditionalInformation
-
Methods inherited from interface adams.flow.transformer.DataContainerDbReader
getDataProvider
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager
-
Methods inherited from interface adams.core.VariablesInspectionHandler
canInspectOptions
-
-
-
-
Field Detail
-
m_Raw
protected boolean m_Raw
whether to return the raw data or not.
-
m_Lenient
protected boolean m_Lenient
whether to ignore not finding any IDs.
-
m_PostProcessor
protected AbstractDataContainerPostProcessor m_PostProcessor
the post-processor to apply to the data.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractActor
-
setRaw
public void setRaw(boolean value)
Sets whether to return the raw data or not (only FilteredDataProviders).- Parameters:
value
- true if transformation is to be skipped- See Also:
FilteredDataProvider
-
getRaw
public boolean getRaw()
Returns whether to return the raw data or not (only FilteredDataProviders).- Returns:
- true if transformation is skipped
- See Also:
FilteredDataProvider
-
rawTipText
public String rawTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLenient
public void setLenient(boolean value)
Sets whether to ignore IDs that weren't found (warning rather than error).- Specified by:
setLenient
in interfaceLenientModeSupporter
- Parameters:
value
- true if to ignore missing IDs
-
getLenient
public boolean getLenient()
Returns whether to ignore IDs that weren't found (warning rather than error).- Specified by:
getLenient
in interfaceLenientModeSupporter
- Returns:
- true if to ignore missing IDs
-
lenientTipText
public String lenientTipText()
Returns the tip text for this property.- Specified by:
lenientTipText
in interfaceLenientModeSupporter
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPostProcessor
public void setPostProcessor(AbstractDataContainerPostProcessor value)
Sets the post-processor to apply to the data.- Parameters:
value
- the post-processor
-
getPostProcessor
public AbstractDataContainerPostProcessor getPostProcessor()
Returns the post-processor in use.- Returns:
- the post-processor
-
postProcessorTipText
public String postProcessorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
accepts
public Class[] accepts()
Returns the class that the consumer accepts.- Specified by:
accepts
in interfaceInputConsumer
- Returns:
- java.lang.Integer.class
-
generates
public abstract Class[] generates()
Returns the class of objects that it generates.- Specified by:
generates
in interfaceOutputProducer
- Returns:
- the data to retrieve from the database
-
queryDatabase
protected String queryDatabase()
Executes the flow item.- Specified by:
queryDatabase
in classAbstractDbTransformer
- Returns:
- null if everything is fine, otherwise error message
-
-