Package jenkins.plugins.git.traits
Class RefSpecsSCMSourceTrait
java.lang.Object
hudson.model.AbstractDescribableImpl<T>
jenkins.scm.api.trait.SCMTrait<jenkins.scm.api.trait.SCMSourceTrait>
jenkins.scm.api.trait.SCMSourceTrait
jenkins.plugins.git.traits.RefSpecsSCMSourceTrait
- All Implemented Interfaces:
ExtensionPoint,Describable<jenkins.scm.api.trait.SCMSourceTrait>
public class RefSpecsSCMSourceTrait
extends jenkins.scm.api.trait.SCMSourceTrait
Exposes the ref specs of a
AbstractGitSCMSource as a SCMSourceTrait.
The ref specs are stored as templates which are intended to be realised by applying
String.replaceAll(String, String) with the AbstractGitSCMSource.REF_SPEC_REMOTE_NAME_PLACEHOLDER
pattern to inject the remote name (which should default to AbstractGitSCMSource.DEFAULT_REMOTE_NAME- Since:
- 3.4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classOurDescriptorstatic classRepresents a single wrapped template for easier form binding.Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
ConstructorsConstructorDescriptionRefSpecsSCMSourceTrait(String... templates) Utility constructor.Stapler constructor. -
Method Summary
Modifier and TypeMethodDescriptionUnwraps the templates.protected voiddecorateBuilder(jenkins.scm.api.trait.SCMBuilder<?, ?> builder) protected voiddecorateContext(jenkins.scm.api.trait.SCMSourceContext<?, ?> context) Gets the templates.Methods inherited from class jenkins.scm.api.trait.SCMSourceTrait
_for, _for, all, applyToBuilder, applyToContext, applyToObserver, decorateObserver, getDescriptor, includeCategory, isCategoryEnabledMethods inherited from class jenkins.scm.api.trait.SCMTrait
asSetList, asSetList, find
-
Constructor Details
-
RefSpecsSCMSourceTrait
@DataBoundConstructor public RefSpecsSCMSourceTrait(@CheckForNull List<RefSpecsSCMSourceTrait.RefSpecTemplate> templates) Stapler constructor.- Parameters:
templates- the templates.
-
RefSpecsSCMSourceTrait
Utility constructor.- Parameters:
templates- the template strings.
-
-
Method Details
-
getTemplates
Gets the templates.- Returns:
- the templates.
-
asStrings
Unwraps the templates.- Returns:
- the templates.
-
decorateContext
protected void decorateContext(jenkins.scm.api.trait.SCMSourceContext<?, ?> context) - Overrides:
decorateContextin classjenkins.scm.api.trait.SCMSourceTrait
-
decorateBuilder
protected void decorateBuilder(jenkins.scm.api.trait.SCMBuilder<?, ?> builder) - Overrides:
decorateBuilderin classjenkins.scm.api.trait.SCMSourceTrait
-