Package hudson.scm
Class SCMDescriptor<T extends SCM>
- java.lang.Object
-
- hudson.model.Descriptor<SCM>
-
- hudson.scm.SCMDescriptor<T>
-
- Type Parameters:
T- The 'self' type that represents the type ofSCMthat this descriptor describes.
- Direct Known Subclasses:
NullSCM.DescriptorImpl
public abstract class SCMDescriptor<T extends SCM> extends Descriptor<SCM>
DescriptorforSCM.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
-
Field Summary
Fields Modifier and Type Field Description Class<? extends RepositoryBrowser>repositoryBrowserIf this SCM has correspondingRepositoryBrowser, that type.-
Fields inherited from class hudson.model.Descriptor
clazz
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSCMDescriptor(Class<? extends RepositoryBrowser> repositoryBrowser)Infers the type of the correspondingSCMfrom the outer class.protectedSCMDescriptor(Class<T> clazz, Class<? extends RepositoryBrowser> repositoryBrowser)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description List<Descriptor<RepositoryBrowser<?>>>getBrowserDescriptors()Returns the list ofRepositoryBrowserDescriptorthat can be used with this SCM.intgetGeneration()Deprecated.No longer used by default.voidincrementGeneration()Deprecated.No longer used by default.booleanisApplicable(AbstractProject project)Deprecated.booleanisApplicable(Job project)AllowsSCMDescriptors to choose which projects it wants to be configurable against.booleanisBrowserReusable(T x, T y)Deprecated.No longer used by default.voidload()Loads the data from the disk into this object.-
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
-
-
-
Field Detail
-
repositoryBrowser
public final transient Class<? extends RepositoryBrowser> repositoryBrowser
If this SCM has correspondingRepositoryBrowser, that type. Otherwise this SCM will not have any repository browser.
-
-
Constructor Detail
-
SCMDescriptor
protected SCMDescriptor(Class<T> clazz, Class<? extends RepositoryBrowser> repositoryBrowser)
-
SCMDescriptor
protected SCMDescriptor(Class<? extends RepositoryBrowser> repositoryBrowser)
Infers the type of the correspondingSCMfrom the outer class. This version works when you follow the common convention, where a descriptor is written as the static nested class of the describable class.- Since:
- 1.278
-
-
Method Detail
-
getGeneration
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("2.209") public int getGeneration()
Deprecated.No longer used by default.Incremented every time a newSCMinstance is created from this descriptor. This is used to invalidate cache ofSCM.getEffectiveBrowser(). Due to the lack of synchronization and serialization, this field doesn't really count the # of instances created to date, but it's good enough for the cache invalidation.
-
incrementGeneration
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("2.209") public void incrementGeneration()
Deprecated.No longer used by default.Increments the generation valuegetGeneration()by one atomically.
-
load
public void load()
Description copied from class:DescriptorLoads the data from the disk into this object.The constructor of the derived class must call this method. (If we do that in the base class, the derived class won't get a chance to set default values.)
- Specified by:
loadin interfaceLoadable- Overrides:
loadin classDescriptor<SCM>
-
isBrowserReusable
@Deprecated public boolean isBrowserReusable(T x, T y)
Deprecated.No longer used by default.SCM.getKey()could be used to implement similar features if needed.Optional method used by the automatic SCM browser inference.Implementing this method allows Hudson to reuse
RepositoryBrowserconfigured for one project to be used for other "compatible" projects.SCM.guessBrowser()is more robust since it does not require another project.- Returns:
- true if the two given SCM configurations are similar enough
that they can reuse
RepositoryBrowserbetween them.
-
isApplicable
public boolean isApplicable(Job project)
AllowsSCMDescriptors to choose which projects it wants to be configurable against.When this method returns false, this
SCMwill not appear in the configuration screen for the given project. The default is true forAbstractProjectbut false forJob.- Since:
- 1.568
-
isApplicable
@Deprecated public boolean isApplicable(AbstractProject project)
Deprecated.
-
getBrowserDescriptors
public List<Descriptor<RepositoryBrowser<?>>> getBrowserDescriptors()
Returns the list ofRepositoryBrowserDescriptorthat can be used with this SCM.- Returns:
- can be empty but never null.
-
-