Package adams.flow.source.git
Class AbstractGitOperation
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.source.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 to use.protected GitRepom_GitRepothe GitRepo instance to use.
-
Constructor Summary
Constructors Constructor Description AbstractGitOperation()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancanExecute(adams.core.MessageCollection errors)Checks whether the git operation can be executed.protected voidcheck(adams.core.MessageCollection errors)Hook method for checking.protected abstract booleandoCanExecute(adams.core.MessageCollection errors)Checks whether the git operation can be executed.protected abstract ObjectdoExecute(adams.core.MessageCollection errors)Executes the git operation.Objectexecute(adams.core.MessageCollection errors)Executes the git operation.abstract Class[]generates()Returns the type of data of the output.GitRepogetGitRepo()Returns the GitRepo instancee 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.-
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 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 instancee in use.- Returns:
- the instance in use
-
generates
public abstract Class[] generates()
Returns the type of data of the output.- Returns:
- the type of data
-
check
protected void check(adams.core.MessageCollection errors)
Hook method for checking.
-
doCanExecute
protected abstract boolean doCanExecute(adams.core.MessageCollection errors)
Checks whether the git operation can be executed.- Parameters:
errors- for storing errors, can be null- Returns:
- whether operation can be executed
-
canExecute
public boolean canExecute(adams.core.MessageCollection errors)
Checks whether the git operation can be executed.- Parameters:
errors- for storing errors, can be null- Returns:
- whether operation can be executed
-
doExecute
protected abstract Object doExecute(adams.core.MessageCollection errors)
Executes the git operation.- Parameters:
errors- for storing errors, can be null- Returns:
- the operation output, null if failed
-
execute
public Object execute(adams.core.MessageCollection errors)
Executes the git operation.- Parameters:
errors- for storing errors, can be null- Returns:
- the operation output, null if failed
-
-