Package jenkins.branch
Class MultiBranchProjectDescriptor
java.lang.Object
hudson.model.Descriptor<TopLevelItem>
hudson.model.TopLevelItemDescriptor
com.cloudbees.hudson.plugins.folder.AbstractFolderDescriptor
jenkins.branch.MultiBranchProjectDescriptor
public abstract class MultiBranchProjectDescriptor
extends com.cloudbees.hudson.plugins.folder.AbstractFolderDescriptor
The Descriptor
for MultiBranchProject
s.
Compatible SCM
s displayed by SingleSCMSource
(via their
SCMDescriptor
) can be defined by overriding TopLevelItemDescriptor.isApplicable(Descriptor)
:
@Override public boolean isApplicable(Descriptor descriptor) { if (descriptor instanceof SCMDescriptor) { SCMDescriptor d = (SCMDescriptor) descriptor; // Your logic } return super.isApplicable(descriptor); }
- Author:
- Stephen Connolly
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
MultiBranchProjectDescriptor.ChildNameGeneratorImpl<P extends Job<P,
R> & TopLevelItem, R extends Run<P, R>> 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
ModifierConstructorDescriptionprotected
Fully inferring constructor to use when the descriptor is an inner class of theMultiBranchProject
and type parameter inference works because it just should work.protected
MultiBranchProjectDescriptor
(Class<? extends MultiBranchProject<?, ?>> clazz) Semi explicit constructor to use when the descriptor is not an inner class of theMultiBranchProject
.protected
MultiBranchProjectDescriptor
(Class<? extends MultiBranchProject<?, ?>> clazz, Class<? extends Job> projectClass) Explicit constructor to use when type inference fails. -
Method Summary
Modifier and TypeMethodDescription<I extends TopLevelItem>
com.cloudbees.hudson.plugins.folder.ChildNameGenerator<com.cloudbees.hudson.plugins.folder.AbstractFolder<I>,I> Returns theBranchSource.DescriptorImpl
.Class<? extends MultiBranchProject>
getClazz()
We have to extendTopLevelItemDescriptor
but we want to be able to accessDescriptor.clazz
as aMultiBranchProject
based type.List<com.cloudbees.hudson.plugins.folder.FolderIconDescriptor>
Returns the base class of the projects that are produced by this factory.Returns theBranchProjectFactoryDescriptor
s.List<jenkins.scm.api.SCMSourceDescriptor>
getSCMSourceDescriptors
(boolean onlyUserInstantiable) Gets theSCMSourceDescriptor
s.boolean
Methods inherited from class com.cloudbees.hudson.plugins.folder.AbstractFolderDescriptor
doCheckDisplayNameOrNull, getCategoryId, getDisplayName, getHealthMetricDescriptors, getIconClassName, getIconFilePathPattern, getPropertyDescriptors, isLookAndFeelConfigurable, isTabBarConfigurable
Methods inherited from class hudson.model.TopLevelItemDescriptor
all, checkApplicableIn, getDescription, getIconFilePath, isApplicable, isApplicableIn, newInstance, newInstance, newInstance, testInstance
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, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Constructor Details
-
MultiBranchProjectDescriptor
protected MultiBranchProjectDescriptor(Class<? extends MultiBranchProject<?, ?>> clazz, Class<? extends Job> projectClass) Explicit constructor to use when type inference fails.- Parameters:
clazz
- theMultiBranchProject
that this descriptor is for.projectClass
- theJob
type that theMultiBranchProject
creates.- Since:
- 2.0
-
MultiBranchProjectDescriptor
Semi explicit constructor to use when the descriptor is not an inner class of theMultiBranchProject
.- Parameters:
clazz
- theMultiBranchProject
that this descriptor is for.- Since:
- 2.0
-
MultiBranchProjectDescriptor
protected MultiBranchProjectDescriptor()Fully inferring constructor to use when the descriptor is an inner class of theMultiBranchProject
and type parameter inference works because it just should work.- Since:
- 2.0
-
-
Method Details
-
getProjectClass
Returns the base class of the projects that are produced by this factory.- Returns:
- the base class of the projects that are produced by this factory.
- Since:
- 2.0
-
getClazz
We have to extendTopLevelItemDescriptor
but we want to be able to accessDescriptor.clazz
as aMultiBranchProject
based type.- Returns:
- the
Descriptor.clazz
-
getSCMSourceDescriptors
@NonNull public List<jenkins.scm.api.SCMSourceDescriptor> getSCMSourceDescriptors(boolean onlyUserInstantiable) Gets theSCMSourceDescriptor
s.- Parameters:
onlyUserInstantiable
-true
retains only thoseSCMSource
types that are instantiable by the user.- Returns:
- the list of
SCMSourceDescriptor
s.
-
getProjectFactoryDescriptors
Returns theBranchProjectFactoryDescriptor
s.- Returns:
- the
BranchProjectFactoryDescriptor
s.
-
getBranchSourceDescriptor
Returns theBranchSource.DescriptorImpl
.- Returns:
- the
BranchSource.DescriptorImpl
.
-
getIconDescriptors
- Overrides:
getIconDescriptors
in classcom.cloudbees.hudson.plugins.folder.AbstractFolderDescriptor
-
isIconConfigurable
public boolean isIconConfigurable()- Overrides:
isIconConfigurable
in classcom.cloudbees.hudson.plugins.folder.AbstractFolderDescriptor
-
childNameGenerator
@NonNull public <I extends TopLevelItem> com.cloudbees.hudson.plugins.folder.ChildNameGenerator<com.cloudbees.hudson.plugins.folder.AbstractFolder<I>,I> childNameGenerator()- Overrides:
childNameGenerator
in classcom.cloudbees.hudson.plugins.folder.AbstractFolderDescriptor
-