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


Java StaplerRequest.bindJSON方法代碼示例

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


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

示例1: createSeries

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
/**
 * Using file and label and the Stapler request, create a subclass of series
 * that can process the type selected.
 * 
 * @param formData
 *            JSON data for series
 */
public static Series createSeries(JSONObject formData, StaplerRequest req) {
    String file = formData.getString("file");
    formData = formData.getJSONObject("fileType");
    formData.put("file", file);
    String type = formData.getString("value");
    Class<? extends Series> typeClass = null;

    if ("properties".equals(type))
        typeClass = PropertiesSeries.class;
    else if ("csv".equals(type))
        typeClass = CSVSeries.class;
    else if ("xml".equals(type))
        typeClass = XMLSeries.class;

    return typeClass != null ? req.bindJSON(typeClass, formData) : null;
}
 
開發者ID:MarkusDNC,項目名稱:plot-plugin,代碼行數:24,代碼來源:SeriesFactory.java

示例2: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest req, JSONObject json)
        throws FormException {

    /**
     * If all cluster configurations are deleted in the UI and saved,
     * binJSON does not set the list. So clear out the list before bind.
     */
    clusterConfigs = null;

    req.bindJSON(this, json.getJSONObject("openshift"));
    save();
    return true;
}
 
開發者ID:openshift,項目名稱:jenkins-client-plugin,代碼行數:15,代碼來源:OpenShift.java

示例3: doSubmit

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
public void doSubmit(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException {
    // '$class' in form data tells Stapler which Fruit subclass to use,
    // older versions of Jenkins/Stapler used 'stapler-class'
    Fruit fruit = req.bindJSON(Fruit.class, req.getSubmittedForm().getJSONObject("fruit"));
    rsp.setContentType("text/plain");
    new XStream2().toXML(fruit, rsp.getWriter());
}
 
開發者ID:10000TB,項目名稱:Jenkins-Plugin-Examples,代碼行數:8,代碼來源:DropdownList.java

示例4: newInstance

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public Config newInstance(@Nonnull final StaplerRequest req, final JSONObject formData) throws FormException {
	Config jiraConfig = req.bindJSON(Config.class, formData);
	if (jiraConfig.siteName == null) {
		jiraConfig = null;
	}
	return jiraConfig;
}
 
開發者ID:ThoughtsLive,項目名稱:jira-steps,代碼行數:9,代碼來源:Config.java

示例5: newInstance

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public Config newInstance(@Nonnull final StaplerRequest req, final JSONObject formData)
    throws FormException {
  Config jiraConfig = req.bindJSON(Config.class, formData);
  if (jiraConfig.siteName == null) {
    jiraConfig = null;
  }
  return jiraConfig;
}
 
開發者ID:jenkinsci,項目名稱:jira-steps-plugin,代碼行數:10,代碼來源:Config.java

示例6: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest req, JSONObject json) throws hudson.model.Descriptor.FormException {
	req.bindJSON(this, json);
	configChange();
	save();
	return true;
}
 
開發者ID:jenkinsci,項目名稱:openshift-sync-plugin,代碼行數:8,代碼來源:GlobalPluginConfiguration.java

示例7: newInstance

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
public JobProperty<?> newInstance(StaplerRequest req, JSONObject formData) throws FormException {
  GogsProjectProperty tpp = req.bindJSON(
          GogsProjectProperty.class,
          formData.getJSONObject(GOGS_PROJECT_BLOCK_NAME)
  );
  if ( tpp != null ) {
    LOGGER.info(formData.toString());
    LOGGER.info(tpp.gogsSecret);

    gogsSecret = tpp.gogsSecret;
  }
  return tpp;
}
 
開發者ID:jenkinsci,項目名稱:gogs-webhook-plugin,代碼行數:14,代碼來源:GogsProjectProperty.java

示例8: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
    final JSONObject rootNode = json.getJSONObject(NAMESPACE);
    req.bindJSON(this, rootNode);

    applyEmptyRulesListWorkaroundIfNeeded(rootNode);

    save();
    return true;
}
 
開發者ID:inFullMobile,項目名稱:restricted-register-plugin,代碼行數:11,代碼來源:PluginGlobalConfig.java

示例9: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest req, JSONObject formData) throws FormException {
    if (!ignoreGlobalSettings) {
        updateFromGlobalConfiguration();
    }

    req.bindJSON(this, formData);
    save();

    return super.configure(req, formData);
}
 
開發者ID:jenkinsci,項目名稱:consul-kv-builder-plugin,代碼行數:12,代碼來源:ConsulKVBuilder.java

示例10: newInstance

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public JobProperty<?> newInstance(StaplerRequest req, JSONObject formData) throws FormException {
    if (formData.isNullObject()) return null;
    JSONObject containersDefinition = formData.getJSONObject("containersDefinition");
    if (containersDefinition.isNullObject()) return null;
    return req.bindJSON(ContainerSetDefinition.class, containersDefinition);
}
 
開發者ID:hyperhq,項目名稱:hyper-slaves-plugin,代碼行數:8,代碼來源:ContainerSetDefinition.java

示例11: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest req, JSONObject formData) throws FormException {
    if (formData.has(NAMESPACE)) {
        JSONObject config = formData.getJSONObject(NAMESPACE);
        req.bindJSON(this, config);
        save();
        if (config.has("usageStatsEnabled")) {
            setEnableUsageStats(config.getBoolean("usageStatsEnabled"));
        }
    }

    return true;
}
 
開發者ID:jenkinsci,項目名稱:browserstack-integration-plugin,代碼行數:14,代碼來源:BrowserStackBuildWrapperDescriptor.java

示例12: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest req, JSONObject formData) throws FormException {
    req.bindJSON(this, formData.getJSONObject("bitbucket-build-status-notifier"));
    save();

    return true;
}
 
開發者ID:jenkinsci,項目名稱:bitbucket-build-status-notifier-plugin,代碼行數:8,代碼來源:BitbucketBuildStatusNotifier.java

示例13: 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

示例14: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
    try {
        checkValidConfiguration(json);
        enabled = json.getBoolean("enabled");
        appId = json.getString("appId");
        secret = json.getString("secret");
        req.bindJSON(this, json);
        save();
        savePluginConfiguration();
        return super.configure(req, json);
    } catch (IOException e) {
        throw new FormException(e, e.getMessage());
    }
}
 
開發者ID:ElevenPaths,項目名稱:latch-plugin-jenkins,代碼行數:16,代碼來源:LatchAppConfig.java

示例15: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(
        final StaplerRequest req,
        final JSONObject formData)
        throws FormException {
    req.bindJSON(this, formData);
    save();

    return super.configure(req, formData);
}
 
開發者ID:awslabs,項目名稱:aws-codepipeline-plugin-for-jenkins,代碼行數:11,代碼來源:AWSCodePipelinePublisher.java


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