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
forMultiBranchProject
s.Compatible
SCM
s displayed bySingleSCMSource
(via theirSCMDescriptor
) can be defined by overridingTopLevelItemDescriptor.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
Nested Classes Modifier and Type Class Description static 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
Constructors Modifier Constructor Description 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.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <I extends TopLevelItem>
com.cloudbees.hudson.plugins.folder.ChildNameGenerator<com.cloudbees.hudson.plugins.folder.AbstractFolder<I>,I>childNameGenerator()
Descriptor<BranchSource>
getBranchSourceDescriptor()
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>
getIconDescriptors()
Class<? extends Job>
getProjectClass()
Returns the base class of the projects that are produced by this factory.List<BranchProjectFactoryDescriptor>
getProjectFactoryDescriptors()
Returns theBranchProjectFactoryDescriptor
s.List<jenkins.scm.api.SCMSourceDescriptor>
getSCMSourceDescriptors(boolean onlyUserInstantiable)
Gets theSCMSourceDescriptor
s.boolean
isIconConfigurable()
-
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 Detail
-
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
protected MultiBranchProjectDescriptor(Class<? extends MultiBranchProject<?,?>> clazz)
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 Detail
-
getProjectClass
@NonNull public Class<? extends Job> 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
@NonNull public Class<? extends MultiBranchProject> 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
@NonNull public List<BranchProjectFactoryDescriptor> getProjectFactoryDescriptors()
Returns theBranchProjectFactoryDescriptor
s.- Returns:
- the
BranchProjectFactoryDescriptor
s.
-
getBranchSourceDescriptor
@NonNull public Descriptor<BranchSource> getBranchSourceDescriptor()
Returns theBranchSource.DescriptorImpl
.- Returns:
- the
BranchSource.DescriptorImpl
.
-
getIconDescriptors
public List<com.cloudbees.hudson.plugins.folder.FolderIconDescriptor> 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
-
-