use of org.kohsuke.stapler.DataBoundSetter in project email-ext-plugin by jenkinsci.
the class ExtendedEmailPublisherDescriptor method setDefaultClasspath.
@DataBoundSetter
public void setDefaultClasspath(List<GroovyScriptPath> defaultClasspath) throws FormException {
if (Jenkins.get().isUseSecurity()) {
ScriptApproval approval = ScriptApproval.get();
ApprovalContext context = ApprovalContext.create().withCurrentUser();
for (GroovyScriptPath path : defaultClasspath) {
URL u = path.asURL();
if (u != null) {
try {
approval.configuring(new ClasspathEntry(u.toString()), context);
} catch (MalformedURLException e) {
throw new FormException(e, "defaultClasspath");
}
}
}
}
this.defaultClasspath = defaultClasspath;
}
use of org.kohsuke.stapler.DataBoundSetter in project jenkins by jenkinsci.
the class ChoiceParameterDefinition method setChoices.
/**
* Set the list of choices. Legal arguments are String (in which case the arguments gets split into lines) and Collection
* which sets the list of legal parameters to the String representations of the argument's non-null entries.
*
* See JENKINS-26143 for background.
*
* This retains the compatibility with the legacy String 'choices' parameter, while supporting the list type as generated
* by the snippet generator.
*
* @param choices String or Collection representing this parameter definition's possible values.
*
* @since 2.112
*/
@DataBoundSetter
// this is terrible enough without being used anywhere
@Restricted(NoExternalUse.class)
public void setChoices(Object choices) {
if (choices instanceof String) {
setChoicesText((String) choices);
return;
}
if (choices instanceof List) {
ArrayList<String> newChoices = new ArrayList<>();
for (Object o : (List) choices) {
if (o != null) {
newChoices.add(o.toString());
}
}
this.choices = newChoices;
return;
}
throw new IllegalArgumentException("expected String or List, but got " + choices.getClass().getName());
}
use of org.kohsuke.stapler.DataBoundSetter in project bitbucket-branch-source-plugin by jenkinsci.
the class BitbucketSCMSource method setBitbucketServerUrl.
@Deprecated
@Restricted(NoExternalUse.class)
@RestrictedSince("2.2.0")
@DataBoundSetter
public void setBitbucketServerUrl(String url) {
url = BitbucketEndpointConfiguration.normalizeServerUrl(url);
AbstractBitbucketEndpoint endpoint = BitbucketEndpointConfiguration.get().findEndpoint(url);
if (endpoint != null) {
// we have a match
setServerUrl(endpoint.getServerUrl());
return;
}
LOGGER.log(Level.WARNING, "Call to legacy setBitbucketServerUrl({0}) method is configuring a url missing " + "from the global configuration.", url);
setServerUrl(url);
}
use of org.kohsuke.stapler.DataBoundSetter in project bitbucket-branch-source-plugin by jenkinsci.
the class BitbucketSCMNavigator method setBitbucketServerUrl.
@Deprecated
@Restricted(DoNotUse.class)
@RestrictedSince("2.2.0")
@DataBoundSetter
public void setBitbucketServerUrl(String url) {
url = BitbucketEndpointConfiguration.normalizeServerUrl(url);
AbstractBitbucketEndpoint endpoint = BitbucketEndpointConfiguration.get().findEndpoint(url);
if (endpoint != null) {
// we have a match
setServerUrl(url);
return;
}
LOGGER.log(Level.WARNING, "Call to legacy setBitbucketServerUrl({0}) method is configuring a url missing " + "from the global configuration.", url);
setServerUrl(url);
}
use of org.kohsuke.stapler.DataBoundSetter in project jms-messaging-plugin by jenkinsci.
the class CIBuildTrigger method setProviders.
@DataBoundSetter
public void setProviders(List<ProviderDataEnvelope> envelopes) {
ArrayList<ProviderData> providers = new ArrayList<>();
for (ProviderDataEnvelope envelope : envelopes) {
ProviderData providerData = envelope.providerData;
if (providerData == null) {
log.warning("Empty provider submitted");
continue;
}
providers.add(providerData);
}
this.providers = providers;
}
Aggregations