Class MultiBranchProjectDescriptor

  • All Implemented Interfaces:
    Saveable, 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 Detail

      • 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 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
      • 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.
      • 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