Package jenkins.scm.api.trait
Class SCMSourceTraitDescriptor
- java.lang.Object
-
- hudson.model.Descriptor<T>
-
- jenkins.scm.api.trait.SCMTraitDescriptor<SCMSourceTrait>
-
- jenkins.scm.api.trait.SCMSourceTraitDescriptor
-
- Direct Known Subclasses:
RegexSCMHeadFilterTrait.DescriptorImpl
,WildcardSCMHeadFilterTrait.DescriptorImpl
public abstract class SCMSourceTraitDescriptor extends SCMTraitDescriptor<SCMSourceTrait>
Abstract base class forDescriptor
ofSCMSourceTrait
implementations.- Since:
- 2.2.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
SCMSourceTraitDescriptor()
Infers the type of the correspondingSCMSourceTrait
from the outer class.protected
SCMSourceTraitDescriptor(Class<? extends SCMSourceTrait> clazz)
Constructor to use when type inference usingSCMSourceTraitDescriptor()
does not work.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<? extends SCMBuilder>
getBuilderClass()
Returns the type ofSCMBuilder
that thisSCMSourceTrait
is applicable to.Class<? extends SCMSourceContext>
getContextClass()
Returns the type ofSCMSourceContext
that thisSCMSourceTrait
is applicable to.Class<? extends SCMSource>
getSourceClass()
Returns the type ofSCMSource
that thisSCMSourceTrait
is applicable to.boolean
isApplicableTo(Class<? extends SCMSource> sourceClass)
Checks if theSCMSourceTrait
is relevant to the specified type ofSCMSource
.boolean
isApplicableTo(SCMSource source)
Checks if theSCMSourceTrait
is relevant to the specifiedSCMSource
.boolean
isApplicableTo(SCMSourceDescriptor descriptor)
Checks if theSCMSourceTrait
is relevant to the specifiedSCMSourceDescriptor
.boolean
isApplicableToBuilder(Class<? extends SCMBuilder> builderClass)
Checks if theSCMSourceTrait
is relevant to the specified type ofSCMBuilder
.boolean
isApplicableToBuilder(SCMBuilder<?,?> builder)
Checks if theSCMSourceTrait
is relevant to the specifiedSCMBuilder
.boolean
isApplicableToContext(Class<? extends SCMSourceContext> contextClass)
Checks if theSCMSourceTrait
is relevant to the specified type ofSCMSourceContext
.boolean
isApplicableToContext(SCMSourceContext context)
Checks if theSCMSourceTrait
is relevant to the specifiedSCMSourceContext
.-
Methods inherited from class jenkins.scm.api.trait.SCMTraitDescriptor
getScmClass, 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, 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
-
SCMSourceTraitDescriptor
protected SCMSourceTraitDescriptor(@NonNull Class<? extends SCMSourceTrait> clazz)
Constructor to use when type inference usingSCMSourceTraitDescriptor()
does not work.- Parameters:
clazz
- Pass in the type ofSCMTrait
-
SCMSourceTraitDescriptor
protected SCMSourceTraitDescriptor()
Infers the type of the correspondingSCMSourceTrait
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 SCMBuilder> getBuilderClass()
Returns the type ofSCMBuilder
that thisSCMSourceTrait
is applicable to.- Returns:
- the type of
SCMBuilder
that thisSCMSourceTrait
is applicable to.
-
isApplicableToBuilder
public boolean isApplicableToBuilder(@NonNull Class<? extends SCMBuilder> builderClass)
Checks if theSCMSourceTrait
is relevant to the specified type ofSCMBuilder
.- Parameters:
builderClass
- the type ofSCMBuilder
.- Returns:
true
if applicable to the specified type ofSCMBuilder
.
-
isApplicableToBuilder
public boolean isApplicableToBuilder(@NonNull SCMBuilder<?,?> builder)
Checks if theSCMSourceTrait
is relevant to the specifiedSCMBuilder
.- Parameters:
builder
- theSCMBuilder
.- Returns:
true
if applicable to the specified type ofSCMBuilder
.
-
getContextClass
public Class<? extends SCMSourceContext> getContextClass()
Returns the type ofSCMSourceContext
that thisSCMSourceTrait
is applicable to.- Returns:
- the type of
SCMSourceContext
that thisSCMSourceTrait
is applicable to.
-
isApplicableToContext
public boolean isApplicableToContext(@NonNull Class<? extends SCMSourceContext> contextClass)
Checks if theSCMSourceTrait
is relevant to the specified type ofSCMSourceContext
.- Parameters:
contextClass
- the type ofSCMSourceContext
.- Returns:
true
if applicable to the specified type ofSCMSourceContext
.
-
isApplicableToContext
public boolean isApplicableToContext(@NonNull SCMSourceContext context)
Checks if theSCMSourceTrait
is relevant to the specifiedSCMSourceContext
.- Parameters:
context
- theSCMSourceContext
.- Returns:
true
if applicable to the specified type ofSCMSourceContext
.
-
getSourceClass
public Class<? extends SCMSource> getSourceClass()
Returns the type ofSCMSource
that thisSCMSourceTrait
is applicable to.- Returns:
- the type of
SCMSource
that thisSCMSourceTrait
is applicable to.
-
isApplicableTo
public boolean isApplicableTo(@NonNull Class<? extends SCMSource> sourceClass)
Checks if theSCMSourceTrait
is relevant to the specified type ofSCMSource
.
-
isApplicableTo
public boolean isApplicableTo(@NonNull SCMSourceDescriptor descriptor)
Checks if theSCMSourceTrait
is relevant to the specifiedSCMSourceDescriptor
.- Parameters:
descriptor
- theSCMSourceDescriptor
.- Returns:
true
if applicable to the specifiedSCMSourceDescriptor
.
-
isApplicableTo
public boolean isApplicableTo(@NonNull SCMSource source)
Checks if theSCMSourceTrait
is relevant to the specifiedSCMSource
.
-
-