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


Java StaplerRequest.getParameter方法代碼示例

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


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

示例1: newInstance

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public TelegramNotifier newInstance(StaplerRequest sr, JSONObject json) {
    String token = sr.getParameter("telegramToken");
    String chatId = sr.getParameter("telegramChatId");
    boolean startNotification = "true".equals(sr.getParameter("telegramStartNotification"));
    boolean notifySuccess = "true".equals(sr.getParameter("telegramNotifySuccess"));
    boolean notifyAborted = "true".equals(sr.getParameter("telegramNotifyAborted"));
    boolean notifyNotBuilt = "true".equals(sr.getParameter("telegramNotifyNotBuilt"));
    boolean notifyUnstable = "true".equals(sr.getParameter("telegramNotifyUnstable"));
    boolean notifyFailure = "true".equals(sr.getParameter("telegramNotifyFailure"));
    boolean notifyBackToNormal = "true".equals(sr.getParameter("telegramNotifyBackToNormal"));
    boolean notifyRepeatedFailure = "true".equals(sr.getParameter("telegramNotifyRepeatedFailure"));
    boolean includeTestSummary = "true".equals(sr.getParameter("includeTestSummary"));
    boolean includeFailedTests = "true".equals(sr.getParameter("includeFailedTests"));
    CommitInfoChoice commitInfoChoice = CommitInfoChoice.forDisplayName(sr.getParameter("telegramCommitInfoChoice"));
    boolean includeCustomMessage = "on".equals(sr.getParameter("includeCustomMessage"));
    String customMessage = sr.getParameter("customMessage");
    return new TelegramNotifier(token, chatId, buildServerUrl, sendAs, startNotification, notifyAborted,
            notifyFailure, notifyNotBuilt, notifySuccess, notifyUnstable, notifyBackToNormal, notifyRepeatedFailure,
            includeTestSummary,includeFailedTests, commitInfoChoice, includeCustomMessage, customMessage);
}
 
開發者ID:FluffyFairyGames,項目名稱:jenkins-telegram-plugin,代碼行數:22,代碼來源:TelegramNotifier.java

示例2: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest sr, JSONObject formData) throws FormException {
    token = sr.getParameter("telegramToken");
    chatId = sr.getParameter("telegramChatId");
    buildServerUrl = sr.getParameter("telegramBuildServerUrl");
    sendAs = sr.getParameter("telegramSendAs");
    if(buildServerUrl == null  || buildServerUrl.equals("")) {
        JenkinsLocationConfiguration jenkinsConfig = new JenkinsLocationConfiguration();
        buildServerUrl = jenkinsConfig.getUrl();
    }
    if (buildServerUrl != null && !buildServerUrl.endsWith("/")) {
        buildServerUrl = buildServerUrl + "/";
    }
    save();
    return super.configure(sr, formData);
}
 
開發者ID:FluffyFairyGames,項目名稱:jenkins-telegram-plugin,代碼行數:17,代碼來源:TelegramNotifier.java

示例3: lookupProvider

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
DisplayURLProvider lookupProvider(StaplerRequest req) {
    final String providerName = req.getParameter("provider");
    if(providerName != null && !providerName.isEmpty()) {
        Iterable<DisplayURLProvider> providers = DisplayURLProvider.all();
        Iterable<DisplayURLProvider> filtered = Iterables.filter(providers, new Predicate<DisplayURLProvider>() {
            @Override
            public boolean apply(@Nullable DisplayURLProvider displayURLProvider) {
                if(displayURLProvider == null) {
                    return false;
                }

                return displayURLProvider.getName().equals(providerName);
            }
        });

        DisplayURLProvider provider = Iterables.getFirst(filtered, null);
        if(provider != null) {
            return provider;
        }
    }

    return lookupProvider();
}
 
開發者ID:jenkinsci,項目名稱:display-url-api-plugin,代碼行數:24,代碼來源:AbstractDisplayAction.java

示例4: newInstance

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public MattermostNotifier newInstance(StaplerRequest sr, JSONObject json) {
	if (sr == null) {
		return null;
	}
	String endpoint = sr.getParameter("mattermostEndpoint");
	String room = sr.getParameter("mattermostRoom");
	String icon = sr.getParameter("mattermostIcon");
	boolean startNotification = "true".equals(sr.getParameter("mattermostStartNotification"));
	boolean notifySuccess = "true".equals(sr.getParameter("mattermostNotifySuccess"));
	boolean notifyAborted = "true".equals(sr.getParameter("mattermostNotifyAborted"));
	boolean notifyNotBuilt = "true".equals(sr.getParameter("mattermostNotifyNotBuilt"));
	boolean notifyUnstable = "true".equals(sr.getParameter("mattermostNotifyUnstable"));
	boolean notifyFailure = "true".equals(sr.getParameter("mattermostNotifyFailure"));
	boolean notifyBackToNormal = "true".equals(sr.getParameter("mattermostNotifyBackToNormal"));
	boolean notifyRepeatedFailure = "true".equals(sr.getParameter("mattermostNotifyRepeatedFailure"));
	boolean includeTestSummary = "true".equals(sr.getParameter("includeTestSummary"));
	CommitInfoChoice commitInfoChoice = CommitInfoChoice.forDisplayName(sr.getParameter("slackCommitInfoChoice"));
	boolean includeCustomAttachmentMessage = "on".equals(sr.getParameter("includeCustomAttachmentMessage"));
	String customAttachmentMessage = sr.getParameter("mattermostCustomAttachmentMessage");
	boolean includeCustomMessage = "on".equals(sr.getParameter("includeCustomMessage"));
	String customMessage = sr.getParameter("mattermostCustomMessage");
	return new MattermostNotifier(endpoint, room, icon, buildServerUrl, sendAs, startNotification, notifyAborted,
			notifyFailure, notifyNotBuilt, notifySuccess, notifyUnstable, notifyBackToNormal, notifyRepeatedFailure,
			includeTestSummary, commitInfoChoice, includeCustomAttachmentMessage, customAttachmentMessage, includeCustomMessage, customMessage);
}
 
開發者ID:jovandeginste,項目名稱:jenkins-mattermost-plugin,代碼行數:27,代碼來源:MattermostNotifier.java

示例5: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest sr, JSONObject formData) throws FormException {
	endpoint = sr.getParameter("mattermostEndpoint");
	room = sr.getParameter("mattermostRoom");
	icon = sr.getParameter("mattermostIcon");
	buildServerUrl = sr.getParameter("mattermostBuildServerUrl");
	sendAs = sr.getParameter("mattermostSendAs");
	if (buildServerUrl == null || buildServerUrl.equals("")) {
		JenkinsLocationConfiguration jenkinsConfig = new JenkinsLocationConfiguration();
		buildServerUrl = jenkinsConfig.getUrl();
	}
	if (buildServerUrl != null && !buildServerUrl.endsWith("/")) {
		buildServerUrl = buildServerUrl + "/";
	}
	save();
	return super.configure(sr, formData);
}
 
開發者ID:jovandeginste,項目名稱:jenkins-mattermost-plugin,代碼行數:18,代碼來源:MattermostNotifier.java

示例6: newInstance

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public SCM newInstance(final StaplerRequest req,
                       final JSONObject formData) throws FormException {
    return new AWSCodePipelineSCM(
            req.getParameter("name"),
            req.getParameter("clearWorkspace") != null,
            req.getParameter("region"),
            req.getParameter("awsAccessKey"),
            req.getParameter("awsSecretKey"),
            req.getParameter("proxyHost"),
            req.getParameter("proxyPort"),
            req.getParameter("category"),
            req.getParameter("provider"),
            req.getParameter("version"),
            new AWSClientFactory());
}
 
開發者ID:awslabs,項目名稱:aws-codepipeline-plugin-for-jenkins,代碼行數:17,代碼來源:AWSCodePipelineSCM.java

示例7: configure

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest sr, JSONObject formData)
        throws Descriptor.FormException {
    mirrorGateAPIUrl = sr.getParameter("mirrorGateAPIUrl");
    mirrorgateCredentialsId = sr.getParameter("_.mirrorgateCredentialsId");
    extraURLs = sr.getParameter("extraURLs");

    save();
    return super.configure(sr, formData);
}
 
開發者ID:BBVA,項目名稱:mirrorgate-jenkins-builds-collector,代碼行數:11,代碼來源:MirrorGatePublisher.java

示例8: setUseDescr

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
private void setUseDescr(StaplerRequest req) {
    String u = req.getParameter("usedescr");
    if (u == null) {
        urlUseDescr = null;
    } else {
        urlUseDescr = "on".equalsIgnoreCase(u)
                || "true".equalsIgnoreCase(u);
    }
}
 
開發者ID:MarkusDNC,項目名稱:plot-plugin,代碼行數:10,代碼來源:Plot.java

示例9: setNumBuilds

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
/**
 * Sets the number of builds to plotpipeline from the "numbuilds" parameter in the
 * given StaplerRequest. If the parameter doesn't exist or isn't an integer
 * then a default is used.
 */
private void setNumBuilds(StaplerRequest req) {
    urlNumBuilds = req.getParameter("numbuilds");
    if (urlNumBuilds != null) {
        try {
            // simply try and parse the string to see if it's a valid
            // number, throw away the result.
            Integer.parseInt(urlNumBuilds);
        } catch (NumberFormatException nfe) {
            urlNumBuilds = null;
        }
    }
}
 
開發者ID:MarkusDNC,項目名稱:plot-plugin,代碼行數:18,代碼來源:Plot.java

示例10: setRightBuildNum

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
/**
 * Sets the right-most build number shown on the plotpipeline from the
 * "rightbuildnum" parameter in the given StaplerRequest. If the parameter
 * doesn't exist or isn't an integer then a default is used.
 */
private void setRightBuildNum(StaplerRequest req) {
    String build = req.getParameter("rightbuildnum");
    if (StringUtils.isBlank(build)) {
        rightBuildNum = Integer.MAX_VALUE;
    } else {
        try {
            rightBuildNum = Integer.parseInt(build);
        } catch (NumberFormatException nfe) {
            LOGGER.log(Level.SEVERE, "Exception converting to integer", nfe);
            rightBuildNum = Integer.MAX_VALUE;
        }
    }
}
 
開發者ID:MarkusDNC,項目名稱:plot-plugin,代碼行數:19,代碼來源:Plot.java

示例11: setWidth

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
/**
 * Sets the plotpipeline width from the "width" parameter in the given
 * StaplerRequest. If the parameter doesn't exist or isn't an integer then a
 * default is used.
 */
private void setWidth(StaplerRequest req) {
    String w = req.getParameter("width");
    if (w == null) {
        width = DEFAULT_WIDTH;
    } else {
        try {
            width = Integer.parseInt(w);
        } catch (NumberFormatException nfe) {
            LOGGER.log(Level.SEVERE, "Exception converting to integer", nfe);
            width = DEFAULT_WIDTH;
        }
    }
}
 
開發者ID:MarkusDNC,項目名稱:plot-plugin,代碼行數:19,代碼來源:Plot.java

示例12: setHeight

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
/**
 * Sets the plotpipeline height from the "height" parameter in the given
 * StaplerRequest. If the parameter doesn't exist or isn't an integer then a
 * default is used.
 */
private void setHeight(StaplerRequest req) {
    String h = req.getParameter("height");
    if (h == null) {
        height = DEFAULT_HEIGHT;
    } else {
        try {
            height = Integer.parseInt(h);
        } catch (NumberFormatException nfe) {
            LOGGER.log(Level.SEVERE, "Exception converting to integer", nfe);
            height = DEFAULT_HEIGHT;
        }
    }
}
 
開發者ID:MarkusDNC,項目名稱:plot-plugin,代碼行數:19,代碼來源:Plot.java

示例13: doGetPlot

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
public void doGetPlot(StaplerRequest req, StaplerResponse rsp) {
    String i = req.getParameter("index");
    Plot plot = getPlot(i);
    try {
        plot.plotGraph(req, rsp);
    } catch (IOException ioe) {
        LOGGER.log(Level.SEVERE, "Exception plotting graph", ioe);
    }
}
 
開發者ID:MarkusDNC,項目名稱:plot-plugin,代碼行數:10,代碼來源:PlotReport.java

示例14: doGetPlotMap

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
public void doGetPlotMap(StaplerRequest req, StaplerResponse rsp) {
    String i = req.getParameter("index");
    Plot plot = getPlot(i);
    try {
        plot.plotGraphMap(req, rsp);
    } catch (IOException ioe) {
        LOGGER.log(Level.SEVERE, "Exception plotting graph", ioe);
    }
}
 
開發者ID:MarkusDNC,項目名稱:plot-plugin,代碼行數:10,代碼來源:PlotReport.java

示例15: newInstance

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public SlackUploader newInstance(StaplerRequest req, JSONObject formData) throws FormException {
    String channel = req.getParameter("channel");
    String token = req.getParameter("token");
    String filePath = req.getParameter("filePath");
    return new SlackUploader(channel, token, filePath);
}
 
開發者ID:masterlittle,項目名稱:SlackUploader,代碼行數:8,代碼來源:SlackUploader.java


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