Package jenkins.branch
Class BranchPropertyStrategyDescriptor
- java.lang.Object
-
- hudson.model.Descriptor<BranchPropertyStrategy>
-
- jenkins.branch.BranchPropertyStrategyDescriptor
-
- Direct Known Subclasses:
DefaultBranchPropertyStrategy.DescriptorImpl
,NamedExceptionsBranchPropertyStrategy.DescriptorImpl
public abstract class BranchPropertyStrategyDescriptor extends Descriptor<BranchPropertyStrategy>
The base class forDescriptor
s orBranchPropertyStrategy
instances.- Author:
- Stephen Connolly
-
-
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 Constructor Description BranchPropertyStrategyDescriptor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static List<BranchPropertyStrategyDescriptor>
all()
Gets all theBranchPropertyStrategyDescriptor
instances.static List<BranchPropertyStrategyDescriptor>
all(MultiBranchProject project, jenkins.scm.api.SCMSourceDescriptor sourceDescriptor)
Gets all theBranchPropertyStrategyDescriptor
instances applicable to the specified project and source.boolean
isApplicable(MultiBranchProject project)
A branch property strategy may not be appropriate for every project, this method lets a strategy opt out of being selectable for a specific project.protected boolean
isApplicable(MultiBranchProjectDescriptor projectDescriptor)
Usually a branch property strategy is more concerned with the specific type of project than the specifics of the project instance.boolean
isApplicable(jenkins.scm.api.SCMSourceDescriptor sourceDescriptor)
A branch property strategy may not be appropriate for every type of source, this method lets a strategy opt out of being selectable for a specific source type.-
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
-
-
-
-
Method Detail
-
isApplicable
public boolean isApplicable(@NonNull jenkins.scm.api.SCMSourceDescriptor sourceDescriptor)
A branch property strategy may not be appropriate for every type of source, this method lets a strategy opt out of being selectable for a specific source type. When this method is called (via stapler) we do not have an instance of the source so this needs to be hooked- Parameters:
sourceDescriptor
- the source descriptor.- Returns:
- true iff this property strategy is relevant with this source.
-
isApplicable
public boolean isApplicable(@NonNull MultiBranchProject project)
A branch property strategy may not be appropriate for every project, this method lets a strategy opt out of being selectable for a specific project.By default it checks
isApplicable(MultiBranchProjectDescriptor)
, and whetherBranchPropertyDescriptor.all(MultiBranchProject)
is nonempty when filtered byDescriptorVisibilityFilter
on the project, which due toBranchPropertyDescriptor.Visibility
also callsBranchPropertyDescriptor.isApplicable(MultiBranchProject)
.- Parameters:
project
- the project.- Returns:
- true iff this property strategy is relevant with this project instance.
-
isApplicable
protected boolean isApplicable(@NonNull MultiBranchProjectDescriptor projectDescriptor)
Usually a branch property strategy is more concerned with the specific type of project than the specifics of the project instance.- Parameters:
projectDescriptor
- the project type.- Returns:
- true iff this property strategy is relevant with this project type.
-
all
public static List<BranchPropertyStrategyDescriptor> all()
Gets all theBranchPropertyStrategyDescriptor
instances.- Returns:
- all the
BranchPropertyStrategyDescriptor
instances.
-
all
public static List<BranchPropertyStrategyDescriptor> all(@NonNull MultiBranchProject project, @NonNull jenkins.scm.api.SCMSourceDescriptor sourceDescriptor)
Gets all theBranchPropertyStrategyDescriptor
instances applicable to the specified project and source.- Parameters:
project
- the projectsourceDescriptor
- the source.- Returns:
- all the
BranchPropertyStrategyDescriptor
instances applicable to the specified project and source.
-
-