Class AbstractScm
- All Implemented Interfaces:
Scm
Scm that returns null for all of the optional contract members.
Required members have no default implementation.
Derived classes should provide their supported features to the constructor. The nullary
constructor assumes the SCM doesn't support any of the optional features.
SCM implementors are strongly encouraged to use this base class for their Scm implementation.
As new features are added SCMs built on this base class will better retain cross-version support because it
will provide null implementations of new optional members.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractScm(Set<com.atlassian.bitbucket.scm.ScmFeature> features) -
Method Summary
Modifier and TypeMethodDescriptionRetrieves aPluginCommandBuilderFactory, used to createcommand buildersfor custom SCM commands.Retrieves aPluginCompareCommandFactory, used to createcommandstailored for comparing refs.Set<com.atlassian.bitbucket.scm.ScmFeature>Retrieves thefeaturesthat are supported by this SCM.Retrieves aPluginPullRequestCommandFactory, used to createcommandstailored for use supporting pull requests.Retrieves aPluginRefCommandFactory, used to createcommandstailored for creatingbranchesandtags.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.bitbucket.scm.Scm
getBulkContentCommandFactory, getCommandFactory, getDefaultBranch, getExtendedCommandFactory, getId, getIntegrityCheckCommandFactory, getMergeStrategies, getMirrorCommandFactory, getName, getStatus, isEmpty
-
Constructor Details
-
AbstractScm
protected AbstractScm() -
AbstractScm
-
-
Method Details
-
getCommandBuilderFactory
Description copied from interface:ScmRetrieves aPluginCommandBuilderFactory, used to createcommand buildersfor custom SCM commands.Implementation Note: This method is optional. SCMs which do not support a
ScmCommandBuildermay returnnull.- Specified by:
getCommandBuilderFactoryin interfaceScm- Returns:
- a command builder factory, or
nullif the SCM does not support command builders - See Also:
-
PluginCommandBuilderFactoryScmFeature.COMMAND_BUILDERS
-
getCompareCommandFactory
Description copied from interface:ScmRetrieves aPluginCompareCommandFactory, used to createcommandstailored for comparing refs.Implementation Note: This method is optional. SCMs which do not support comparing refs may return
null.- Specified by:
getCompareCommandFactoryin interfaceScm- Returns:
- a compare command factory, or
nullif the SCM does not support it - See Also:
-
PluginCompareCommandFactoryScmFeature.COMPARE
-
getFeatures
Description copied from interface:ScmRetrieves thefeaturesthat are supported by this SCM.Since the system relies on optional features to provide some functionality, like branch compare and pull requests, it relies on this set to disable functionality that requires features the SCM doesn't provide. Similarly, plugin developers can use the returned features to control which optional features they try to use, rather than checking for
nullor handlingUnsupportedOperationExceptions.- Specified by:
getFeaturesin interfaceScm- Returns:
- the set of optional features this SCM supports, which may be empty but never
null
-
getPullRequestCommandFactory
Description copied from interface:ScmRetrieves aPluginPullRequestCommandFactory, used to createcommandstailored for use supporting pull requests.Repositoriesusing an SCM which implements this method will have the ability to create, view and merge pull requests.Implementation Note: This method is optional. SCMs which do not support pull requests may return
null.Repositoriesusing such SCMs will not be able to create pull requests.- Specified by:
getPullRequestCommandFactoryin interfaceScm- Returns:
- a pull request command factory, or
nullif the SCM does not support pull requests - See Also:
-
PluginPullRequestCommandFactoryScmFeature.PULL_REQUESTS
-
getRefCommandFactory
Description copied from interface:ScmRetrieves aPluginRefCommandFactory, used to createcommandstailored for creatingbranchesandtags.Implementation Note: This method is optional. SCMs which do not support mutable refs may return
null.Repositoriesusing such SCMs will not be able createbranchesandtags.- Specified by:
getRefCommandFactoryin interfaceScm- Returns:
- a plugin ref command factory
- See Also:
-
ScmFeature.REFS
-