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.SCMSourceTraitExposes the ref specs of aAbstractGitSCMSourceas 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_PLACEHOLDERpattern 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 classRefSpecsSCMSourceTrait.DescriptorImplOurDescriptorstatic classRefSpecsSCMSourceTrait.RefSpecTemplateRepresents 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 voiddecorateBuilder(jenkins.scm.api.trait.SCMBuilder<?,?> builder)protected voiddecorateContext(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:
decorateContextin classjenkins.scm.api.trait.SCMSourceTrait
-
decorateBuilder
protected void decorateBuilder(jenkins.scm.api.trait.SCMBuilder<?,?> builder)
- Overrides:
decorateBuilderin classjenkins.scm.api.trait.SCMSourceTrait
-
-