Package adams.flow.transformer.git
Class AbstractGitOperation
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.git.AbstractGitOperation
-
- 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.SizeOfHandler,Serializable
public abstract class AbstractGitOperation extends adams.core.option.AbstractOptionHandler implements adams.core.QuickInfoSupporterAncestor for git operations.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected GitOperationm_GitOperationthe git operation instance to use.protected GitRepom_GitRepothe GitRepo instance to use.
-
Constructor Summary
Constructors Constructor Description AbstractGitOperation()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Class[]accepts()The type of data accepted as input.booleancanExecute(Object input, adams.core.MessageCollection errors)Checks whether the git operation can be executed.protected voidcheck(Object input, adams.core.MessageCollection errors)Hook method for checking.protected abstract booleandoCanExecute(Object input, adams.core.MessageCollection errors)Checks whether the git operation can be executed.protected abstract ObjectdoExecute(Object input, adams.core.MessageCollection errors)Executes the git operation.Objectexecute(Object input, adams.core.MessageCollection errors)Executes the git operation.abstract Class[]generates()The type of data that is being generated.GitRepogetGitRepo()Returns the GitRepo instance in use.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.booleanrequiresGitRepo()Whether a GitRepo instance is required.voidsetGitRepo(GitRepo value)Sets the GitRepo instance to use.static File[]toFiles(Object input)Converts String/File and String[]/File[] to a file array.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_GitRepo
protected GitRepo m_GitRepo
the GitRepo instance to use.
-
m_GitOperation
protected GitOperation m_GitOperation
the git operation instance to use.
-
-
Method Detail
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.
Default implementation returns null.- Specified by:
getQuickInfoin interfaceadams.core.QuickInfoSupporter- Returns:
- null if no info available, otherwise short string
-
requiresGitRepo
public boolean requiresGitRepo()
Whether a GitRepo instance is required.- Returns:
- true if required
-
setGitRepo
public void setGitRepo(GitRepo value)
Sets the GitRepo instance to use.- Parameters:
value- the instance to use
-
getGitRepo
public GitRepo getGitRepo()
Returns the GitRepo instance in use.- Returns:
- the instance in use
-
accepts
public abstract Class[] accepts()
The type of data accepted as input.- Returns:
- the accepted input
-
generates
public abstract Class[] generates()
The type of data that is being generated.- Returns:
- the generated output
-
check
protected void check(Object input, adams.core.MessageCollection errors)
Hook method for checking.- Parameters:
input- the input data
-
doCanExecute
protected abstract boolean doCanExecute(Object input, adams.core.MessageCollection errors)
Checks whether the git operation can be executed.- Parameters:
input- the input dataerrors- for storing errors, can be null- Returns:
- whether operation can be executed
-
canExecute
public boolean canExecute(Object input, adams.core.MessageCollection errors)
Checks whether the git operation can be executed.- Parameters:
input- the input dataerrors- for storing errors, can be null- Returns:
- whether operation can be executed
-
doExecute
protected abstract Object doExecute(Object input, adams.core.MessageCollection errors)
Executes the git operation.- Parameters:
input- the input dataerrors- for storing errors, can be null- Returns:
- the result of the operation
-
execute
public Object execute(Object input, adams.core.MessageCollection errors)
Executes the git operation.- Parameters:
input- the input dataerrors- for storing errors, can be null- Returns:
- the result of the operation
-
-