本文整理匯總了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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}