Class MultiBranchProjectDescriptor

java.lang.Object
hudson.model.Descriptor<TopLevelItem>
hudson.model.TopLevelItemDescriptor
com.cloudbees.hudson.plugins.folder.AbstractFolderDescriptor
jenkins.branch.MultiBranchProjectDescriptor
All Implemented Interfaces:
Saveable, Loadable, OnMaster, IconSpec

public abstract class MultiBranchProjectDescriptor extends com.cloudbees.hudson.plugins.folder.AbstractFolderDescriptor

The Descriptor for MultiBranchProjects.

Compatible SCMs 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
  • Constructor Details

    • MultiBranchProjectDescriptor

      protected MultiBranchProjectDescriptor(Class<? extends MultiBranchProject<?,?>> clazz, Class<? extends Job> projectClass)
      Explicit constructor to use when type inference fails.
      Parameters:
      clazz - the MultiBranchProject that this descriptor is for.
      projectClass - the Job type that the MultiBranchProject 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 the MultiBranchProject.
      Parameters:
      clazz - the MultiBranchProject that this descriptor is for.
      Since:
      2.0
    • MultiBranchProjectDescriptor

      protected MultiBranchProjectDescriptor()
      Fully inferring constructor to use when the descriptor is an inner class of the MultiBranchProject and type parameter inference works because it just should work.
      Since:
      2.0
  • Method Details

    • 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 extend TopLevelItemDescriptor but we want to be able to access Descriptor.clazz as a MultiBranchProject based type.
      Returns:
      the Descriptor.clazz
    • getSCMSourceDescriptors

      @NonNull public List<jenkins.scm.api.SCMSourceDescriptor> getSCMSourceDescriptors(boolean onlyUserInstantiable)
      Gets the SCMSourceDescriptors.
      Parameters:
      onlyUserInstantiable - true retains only those SCMSource types that are instantiable by the user.
      Returns:
      the list of SCMSourceDescriptors.
    • getProjectFactoryDescriptors

      @NonNull public List<BranchProjectFactoryDescriptor> getProjectFactoryDescriptors()
      Returns:
      the BranchProjectFactoryDescriptors.
    • getBranchSourceDescriptor

      @NonNull public Descriptor<BranchSource> getBranchSourceDescriptor()
      Returns:
      the BranchSource.DescriptorImpl.
    • getIconDescriptors

      public List<com.cloudbees.hudson.plugins.folder.FolderIconDescriptor> getIconDescriptors()
      Overrides:
      getIconDescriptors in class com.cloudbees.hudson.plugins.folder.AbstractFolderDescriptor
    • isIconConfigurable

      public boolean isIconConfigurable()
      Overrides:
      isIconConfigurable in class com.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 class com.cloudbees.hudson.plugins.folder.AbstractFolderDescriptor