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 aAbstractGitSCMSource
as aSCMSourceTrait
. The ref specs are stored as templates which are intended to be realised by applyingString.replaceAll(String, String)
with theAbstractGitSCMSource.REF_SPEC_REMOTE_NAME_PLACEHOLDER
pattern to inject the remote name (which should default toAbstractGitSCMSource.DEFAULT_REMOTE_NAME
- Since:
- 3.4.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RefSpecsSCMSourceTrait.DescriptorImpl
OurDescriptor
static class
RefSpecsSCMSourceTrait.RefSpecTemplate
Represents a single wrapped template for easier form binding.-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description RefSpecsSCMSourceTrait(String... templates)
Utility constructor.RefSpecsSCMSourceTrait(List<RefSpecsSCMSourceTrait.RefSpecTemplate> templates)
Stapler constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
asStrings()
Unwraps the templates.protected void
decorateBuilder(jenkins.scm.api.trait.SCMBuilder<?,?> builder)
protected void
decorateContext(jenkins.scm.api.trait.SCMSourceContext<?,?> context)
List<RefSpecsSCMSourceTrait.RefSpecTemplate>
getTemplates()
Gets the templates.
-
-
-
Constructor Detail
-
RefSpecsSCMSourceTrait
@DataBoundConstructor public RefSpecsSCMSourceTrait(@CheckForNull List<RefSpecsSCMSourceTrait.RefSpecTemplate> templates)
Stapler constructor.- Parameters:
templates
- the templates.
-
RefSpecsSCMSourceTrait
public RefSpecsSCMSourceTrait(String... templates)
Utility constructor.- Parameters:
templates
- the template strings.
-
-
Method Detail
-
getTemplates
@NonNull public List<RefSpecsSCMSourceTrait.RefSpecTemplate> getTemplates()
Gets the templates.- Returns:
- the templates.
-
decorateContext
protected void decorateContext(jenkins.scm.api.trait.SCMSourceContext<?,?> context)
- Overrides:
decorateContext
in classjenkins.scm.api.trait.SCMSourceTrait
-
decorateBuilder
protected void decorateBuilder(jenkins.scm.api.trait.SCMBuilder<?,?> builder)
- Overrides:
decorateBuilder
in classjenkins.scm.api.trait.SCMSourceTrait
-
-