当前位置: 首页>>代码示例>>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;未经允许,请勿转载。