Package jenkins.scm.api
Class SCMSourceDescriptor
- Direct Known Subclasses:
- SingleSCMSource.DescriptorImpl
A 
Descriptor for SCMSources.- 
Nested Class SummaryNested classes/interfaces inherited from class hudson.model.DescriptorDescriptor.FormException, Descriptor.PropertyType, Descriptor.Self
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected Set<SCMHeadCategory>The set ofSCMHeadCategorysingletons for this type ofSCMSourceFields inherited from class hudson.model.Descriptorclazz
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected SCMHeadCategory[]Creates the singletonSCMHeadCategoryinstances that this type ofSCMSourceis capable of producing.static List<SCMSourceDescriptor>forOwner(Class<? extends SCMSourceOwner> clazz) Returns the list of descriptors that are appropriate for a specified type of owner andisUserInstantiable().static List<SCMSourceDescriptor>forOwner(Class<? extends SCMSourceOwner> clazz, boolean onlyUserInstantiable) Returns the list of descriptors that are appropriate for a specified type of owner with the additional filter byisUserInstantiable().static List<SCMSourceDescriptor>forOwner(SCMSourceOwner owner) Returns the list of descriptors that are appropriate for a specified owner andisUserInstantiable().static List<SCMSourceDescriptor>forOwner(SCMSourceOwner owner, boolean onlyUserInstantiable) Returns the list of descriptors that are appropriate for a specified owner with the additional filter byisUserInstantiable().final Set<SCMHeadCategory>Returns the set ofSCMHeadCategorythat thisSCMSourcesupports.Used to categorize this kind ofSCMSourceReturn or generate the ID for a source instance.Get the term used in the UI to represent this kind ofSCMSource.Returns the default traits for thisSCMSource.booleanisApplicable(Class<? extends SCMSourceOwner> owner) Returnstrueif this source type is applicable to the given owner.booleanReturnstrueif the source type is one that the user is permitted to configure.Methods inherited from class hudson.model.DescriptoraddHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, configure, configure, doHelp, 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, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
- 
Field Details- 
categoriesThe set ofSCMHeadCategorysingletons for this type ofSCMSource- Since:
- 2.0
- See Also:
 
 
- 
- 
Constructor Details- 
SCMSourceDescriptorpublic SCMSourceDescriptor()
 
- 
- 
Method Details- 
getIdReturn or generate the ID for a source instance.- Parameters:
- source- the source or- nullif a new source.
- Returns:
- the ID of the supplied source or a newly generated ID to use for a new source instance.
 
- 
isApplicableReturnstrueif this source type is applicable to the given owner.- Parameters:
- owner- the type of owner.
- Returns:
- true to allow user to select and configure this source.
 
- 
isUserInstantiable@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isUserInstantiable()Returnstrueif the source type is one that the user is permitted to configure. Where a source is used to wrap or decorate another source it may make sense to returnfalse.- Returns:
- trueif the source type is one that the user is permitted to configure via the UI.
 
- 
getTraitsDefaultsReturns the default traits for thisSCMSource.- Returns:
- An empty list if not overridden.
 
- 
forOwnerReturns the list of descriptors that are appropriate for a specified owner andisUserInstantiable().- Parameters:
- owner- the owner.
- Returns:
- the list of descriptors
 
- 
forOwner@NonNull public static List<SCMSourceDescriptor> forOwner(@CheckForNull SCMSourceOwner owner, boolean onlyUserInstantiable) Returns the list of descriptors that are appropriate for a specified owner with the additional filter byisUserInstantiable().- Parameters:
- owner- the owner.
- onlyUserInstantiable-- trueif only those descriptors that are- isUserInstantiable().
- Returns:
- the list of descriptors
 
- 
forOwnerReturns the list of descriptors that are appropriate for a specified type of owner andisUserInstantiable().- Parameters:
- clazz- the type of owner.
- Returns:
- the list of descriptors
 
- 
forOwner@NonNull public static List<SCMSourceDescriptor> forOwner(Class<? extends SCMSourceOwner> clazz, boolean onlyUserInstantiable) Returns the list of descriptors that are appropriate for a specified type of owner with the additional filter byisUserInstantiable().- Parameters:
- clazz- the type of owner.
- onlyUserInstantiable-- trueif only those descriptors that are- isUserInstantiable().
- Returns:
- the list of descriptors
 
- 
getIconClassNameUsed to categorize this kind ofSCMSource- Specified by:
- getIconClassNamein interface- IconSpec
- Returns:
- The Icon class specification e.g. 'icon-notepad'.
 
- 
getPronounGet the term used in the UI to represent this kind ofSCMSource. Must start with a capital letter.- Returns:
- the term or nullto fall back to the calling context's default.
- Since:
- 2.0
 
- 
getCategoriesReturns the set ofSCMHeadCategorythat thisSCMSourcesupports. There will always be exactly oneSCMCategory.isUncategorized()instance in the returned set.- Returns:
- the set of SCMHeadCategorythat thisSCMSourcesupports.
- Since:
- 2.0
 
- 
createCategoriesCreates the singletonSCMHeadCategoryinstances that this type ofSCMSourceis capable of producing.- Returns:
- the singleton SCMHeadCategoryinstances for this type ofSCMSource
- Since:
- 2.0
- See Also:
 
 
-