Package jenkins.plugins.git.traits
Class GitSCMExtensionTraitDescriptor
- java.lang.Object
-
- hudson.model.Descriptor<T>
-
- jenkins.scm.api.trait.SCMTraitDescriptor<jenkins.scm.api.trait.SCMSourceTrait>
-
- jenkins.scm.api.trait.SCMSourceTraitDescriptor
-
- jenkins.plugins.git.traits.GitSCMExtensionTraitDescriptor
-
- Direct Known Subclasses:
AuthorInChangelogTrait.DescriptorImpl
,CheckoutOptionTrait.DescriptorImpl
,CleanAfterCheckoutTrait.DescriptorImpl
,CleanBeforeCheckoutTrait.DescriptorImpl
,CloneOptionTrait.DescriptorImpl
,FirstBuildChangelogTrait.DescriptorImpl
,GitLFSPullTrait.DescriptorImpl
,LocalBranchTrait.DescriptorImpl
,PruneStaleBranchTrait.DescriptorImpl
,PruneStaleTagTrait.DescriptorImpl
,SparseCheckoutPathsTrait.DescriptorImpl
,SubmoduleOptionTrait.DescriptorImpl
,UserIdentityTrait.DescriptorImpl
,WipeWorkspaceTrait.DescriptorImpl
public abstract class GitSCMExtensionTraitDescriptor extends jenkins.scm.api.trait.SCMSourceTraitDescriptor
Base class for theDescriptor
of aGitSCMExtension
.- Since:
- 3.4.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
-
Field Summary
-
Fields inherited from class hudson.model.Descriptor
clazz
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
GitSCMExtensionTraitDescriptor()
Infers the type of the correspondingGitSCMExtensionTrait
from the outer class.protected
GitSCMExtensionTraitDescriptor(Class<? extends jenkins.scm.api.trait.SCMSourceTrait> clazz, Class<? extends GitSCMExtension> extension)
Constructor to use when type inference usingGitSCMExtensionTraitDescriptor()
does not work.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description jenkins.scm.api.trait.SCMSourceTrait
convertToTrait(GitSCMExtension extension)
Converts the suppliedGitSCMExtension
(which must be of typegetExtensionClass()
) into its correspondingGitSCMExtensionTrait
.Class<? extends jenkins.scm.api.trait.SCMBuilder>
getBuilderClass()
Class<? extends GitSCMExtension>
getExtensionClass()
Returns the type ofGitSCMExtension
that theGitSCMExtensionTrait
wraps.GitSCMExtensionDescriptor
getExtensionDescriptor()
Returns theGitSCMExtensionDescriptor
for thisgetExtensionClass()
.String
getHelpFile()
Class<? extends SCM>
getScmClass()
-
Methods inherited from class jenkins.scm.api.trait.SCMSourceTraitDescriptor
getContextClass, getSourceClass, isApplicableTo, isApplicableTo, isApplicableTo, isApplicableToBuilder, isApplicableToBuilder, isApplicableToContext, isApplicableToContext
-
Methods inherited from class jenkins.scm.api.trait.SCMTraitDescriptor
isApplicableToSCM, isApplicableToSCM
-
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, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
-
-
-
Constructor Detail
-
GitSCMExtensionTraitDescriptor
protected GitSCMExtensionTraitDescriptor(Class<? extends jenkins.scm.api.trait.SCMSourceTrait> clazz, Class<? extends GitSCMExtension> extension)
Constructor to use when type inference usingGitSCMExtensionTraitDescriptor()
does not work.- Parameters:
clazz
- Pass in the type ofSCMTrait
extension
- Pass in the type ofGitSCMExtension
.
-
GitSCMExtensionTraitDescriptor
protected GitSCMExtensionTraitDescriptor()
Infers the type of the correspondingGitSCMExtensionTrait
from 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.
-
-
Method Detail
-
getBuilderClass
public Class<? extends jenkins.scm.api.trait.SCMBuilder> getBuilderClass()
- Overrides:
getBuilderClass
in classjenkins.scm.api.trait.SCMSourceTraitDescriptor
-
getScmClass
public Class<? extends SCM> getScmClass()
- Overrides:
getScmClass
in classjenkins.scm.api.trait.SCMTraitDescriptor<jenkins.scm.api.trait.SCMSourceTrait>
-
getExtensionDescriptor
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public GitSCMExtensionDescriptor getExtensionDescriptor()
Returns theGitSCMExtensionDescriptor
for thisgetExtensionClass()
.- Returns:
- the
GitSCMExtensionDescriptor
for thisgetExtensionClass()
.
-
getExtensionClass
public Class<? extends GitSCMExtension> getExtensionClass()
Returns the type ofGitSCMExtension
that theGitSCMExtensionTrait
wraps.- Returns:
- the type of
GitSCMExtension
that theGitSCMExtensionTrait
wraps.
-
convertToTrait
@CheckForNull public jenkins.scm.api.trait.SCMSourceTrait convertToTrait(@NonNull GitSCMExtension extension)
Converts the suppliedGitSCMExtension
(which must be of typegetExtensionClass()
) into its correspondingGitSCMExtensionTrait
. The default implementation assumes that theDescriptor.clazz
has a public constructor taking either no arguments or a single argument of typegetExtensionClass()
and will just call that. Override this method if you need more complex conversion logic, for exampleLocalBranch
only makes sense for aLocalBranch.getLocalBranch()
value of**
soLocalBranchTrait.DescriptorImpl.convertToTrait(GitSCMExtension)
returnsnull
for all otherLocalBranch
configurations.- Parameters:
extension
- theGitSCMExtension
(must be of typegetExtensionClass()
)- Returns:
- the
GitSCMExtensionTrait
ornull
if the suppliedGitSCMExtension
is not appropriate for conversion to aGitSCMExtensionTrait
- Throws:
UnsupportedOperationException
- if the conversion failed because of a implementation bug.
-
getHelpFile
public String getHelpFile()
- Overrides:
getHelpFile
in classDescriptor<jenkins.scm.api.trait.SCMSourceTrait>
-
-