當前位置: 首頁>>代碼示例>>Java>>正文


Java StaplerRequest.bindJSONToList方法代碼示例

本文整理匯總了Java中org.kohsuke.stapler.StaplerRequest.bindJSONToList方法的典型用法代碼示例。如果您正苦於以下問題:Java StaplerRequest.bindJSONToList方法的具體用法?Java StaplerRequest.bindJSONToList怎麽用?Java StaplerRequest.bindJSONToList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.kohsuke.stapler.StaplerRequest的用法示例。


在下文中一共展示了StaplerRequest.bindJSONToList方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(final StaplerRequest req, final JSONObject json) throws FormException {
    Object sqsQueues = json.get("sqsQueues");
    if (json.size() == 1) {
        String key = json.keys().next().toString();
        sqsQueues = json.getJSONObject(key).get("sqsQueues");
    }
    this.sqsQueues = req.bindJSONToList(SQSTriggerQueue.class, sqsQueues);
    this.initQueueMap();

    this.save();

    EventBroker.getInstance().post(new ConfigurationChangedEvent());
    return true;
}
 
開發者ID:riboseinc,項目名稱:aws-codecommit-trigger-plugin,代碼行數:16,代碼來源:SQSTrigger.java

示例2: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest req, JSONObject json)
        throws FormException {
    // reject empty tool names...
    List<NinjaTool> ninjas = req.bindJSONToList(NinjaTool.class,
            json.get("tool"));
    for (NinjaTool tool : ninjas) {
        if (Util.fixEmpty(tool.getName()) == null)
            throw new FormException(getDisplayName()
                    + " installation requires a name", "_.name");
    }

    super.configure(req, json);
    save();
    return true;
}
 
開發者ID:15knots,項目名稱:jenkins-ninja-installer,代碼行數:17,代碼來源:NinjaTool.java

示例3: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest req, JSONObject formData) throws FormException {
    cron = formData.getString("cron");
    outputFile = formData.getString("outputFile");
    unstableAs = GHCommitState.valueOf(formData.getString("unstableAs"));
    autoCloseFailedPullRequests = formData.getBoolean("autoCloseFailedPullRequests");
    displayBuildErrorsOnDownstreamBuilds = formData.getBoolean("displayBuildErrorsOnDownstreamBuilds");
    
    githubAuth = req.bindJSONToList(GhprcGitHubAuth.class, formData.get("githubAuth"));
    
    extensions = new DescribableList<GhprcExtension, GhprcExtensionDescriptor>(Saveable.NOOP);

    try {
        extensions.rebuildHetero(req, formData, getGlobalExtensionDescriptors(), "extensions");
    } catch (IOException e) {
        e.printStackTrace();
    }
    
    readBackFromLegacy();

    save();
    return super.configure(req, formData);
}
 
開發者ID:bratchenko,項目名稱:jenkins-github-pull-request-comments,代碼行數:24,代碼來源:GhprcTrigger.java

示例4: newInstance

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
/**
* This method is called by hudson if the user has clicked the add button of the Aptly site hosts point in the System Configuration
* web page. It's create a new instance of the {@link AptlyPublisher} class and added all configured ftp sites to this instance by calling
* the method {@link AptlyPublisher#getEntries()} and on it's return value the addAll method is called.
*
* {@inheritDoc}
*
* @param req
*          {@inheritDoc}
* @return {@inheritDoc}
* @see hudson.model.Descriptor#newInstance(org.kohsuke.stapler.StaplerRequest)
*/
@Override
public Publisher newInstance(StaplerRequest req, JSONObject formData) {
   AptlyPublisher pub = new AptlyPublisher();
   try {
        List<PackageItem> entries = req.bindJSONToList(PackageItem.class, formData.get("packageItems"));
        pub.getPackageItems().addAll(entries);
   } catch (Exception e) {
       LOG.severe(">> bindJSONToList Exception: " + e.getMessage());
       return null;
   }
   return pub;
}
 
開發者ID:zgyarmati,項目名稱:aptly-plugin,代碼行數:25,代碼來源:AptlyPublisher.java

示例5: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
/**
* {@inheritDoc}
*
* @param req
*          {@inheritDoc}
* @return {@inheritDoc}
* @see hudson.model.Descriptor#configure(org.kohsuke.stapler.StaplerRequest)
*/
@Override
public boolean configure(StaplerRequest req, JSONObject formData) 
{
    
    List<AptlySite> asites = req.bindJSONToList(AptlySite.class,
                                formData.get("site"));
    sites.replaceBy(asites);
    save();
    return true;
}
 
開發者ID:zgyarmati,項目名稱:aptly-plugin,代碼行數:19,代碼來源:AptlyPublisher.java

示例6: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
    req.bindJSON(this, json);
    // stapler oddity, empty lists coming from the HTTP request are not set on bean by  "req.bindJSON(this, json)"
    this.publisherOptions = req.bindJSONToList(MavenPublisher.class, json.get("publisherOptions"));
    save();
    return true;
}
 
開發者ID:jenkinsci,項目名稱:pipeline-maven-plugin,代碼行數:9,代碼來源:GlobalPipelineMavenConfig.java

示例7: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest req, JSONObject formData) throws Descriptor.FormException {
    List<OctopusDeployServer> servers = null;
    JSONObject json = formData.getJSONObject("octopusConfig");

    if (!json.isEmpty()) {
        servers = req.bindJSONToList(OctopusDeployServer.class, json.get("servers"));
    }
    setOctopusDeployServers(servers);

    save();
    return super.configure(req, formData);
}
 
開發者ID:vistaprint,項目名稱:octopus-jenkins-plugin,代碼行數:14,代碼來源:OctopusDeployPlugin.java

示例8: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest req, JSONObject formData) throws FormException {
    diskPools = req.bindJSONToList(DiskPool.class, formData.get("diskPools"));
    save();
    return super.configure(req, formData);
}
 
開發者ID:jenkinsci,項目名稱:external-workspace-manager-plugin,代碼行數:7,代碼來源:ExwsAllocateStep.java

示例9: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest req, JSONObject formData) throws FormException {
    templates = req.bindJSONToList(Template.class, formData.get("templates"));
    save();
    return super.configure(req, formData);
}
 
開發者ID:jenkinsci,項目名稱:external-workspace-manager-plugin,代碼行數:7,代碼來源:ExwsStep.java


注:本文中的org.kohsuke.stapler.StaplerRequest.bindJSONToList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。