本文整理汇总了Java中com.atlassian.bamboo.utils.error.ErrorCollection.addError方法的典型用法代码示例。如果您正苦于以下问题:Java ErrorCollection.addError方法的具体用法?Java ErrorCollection.addError怎么用?Java ErrorCollection.addError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.atlassian.bamboo.utils.error.ErrorCollection
的用法示例。
在下文中一共展示了ErrorCollection.addError方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validate
import com.atlassian.bamboo.utils.error.ErrorCollection; //导入方法依赖的package包/类
@Override
public void validate(final ActionParametersMap params, final ErrorCollection errorCollection)
{
super.validate(params, errorCollection);
if (StringUtils.isEmpty(params.getString(DeployTaskConstants.STACK_NAME)))
{
errorCollection.addError(DeployTaskConstants.STACK_NAME, textProvider.getText("bamboo-opsworks.stack_name.required"));
}
if (StringUtils.isEmpty(params.getString(DeployTaskConstants.APP_NAME)))
{
errorCollection.addError(DeployTaskConstants.APP_NAME, textProvider.getText("bamboo-opsworks.app_name.required"));
}
if(StringUtils.isEmpty(params.getString(AWSConstants.ACCESS_KEY_ID))
&& !StringUtils.isEmpty(params.getString(AWSConstants.SECRET_ACCESS_KEY))) {
errorCollection.addError(AWSConstants.ACCESS_KEY_ID, textProvider.getText("bamboo-opsworks.access_key_id.required_with_secret"));
}
if(StringUtils.isEmpty(params.getString(AWSConstants.SECRET_ACCESS_KEY))
&& !StringUtils.isEmpty(params.getString(AWSConstants.ACCESS_KEY_ID))) {
errorCollection.addError(AWSConstants.SECRET_ACCESS_KEY, textProvider.getText("bamboo-opsworks.secret_access_key.required_with_access"));
}
}
示例2: validate
import com.atlassian.bamboo.utils.error.ErrorCollection; //导入方法依赖的package包/类
public void validate(@NotNull ActionParametersMap params, @NotNull ErrorCollection errorCollection) {
super.validate(params, errorCollection);
final String directory = params.getString(xUnitParserTask.TEST_FILE_PATTERN);
if (StringUtils.isEmpty(directory))
{
errorCollection.addError(xUnitParserTask.TEST_FILE_PATTERN, i18nResolver.getText(xUnitParserTask.TEST_FILE_PATTERN + ".error"));
}
}
示例3: checkValidationErrors
import com.atlassian.bamboo.utils.error.ErrorCollection; //导入方法依赖的package包/类
private void checkValidationErrors(final HubScanConfigFieldEnum field,
final ValidationResults result,
final ErrorCollection errorCollection) {
if (result.hasErrors()) {
final String message = result.getResultString(field);
errorCollection.addError(field.getKey(), message);
}
}
示例4: validate
import com.atlassian.bamboo.utils.error.ErrorCollection; //导入方法依赖的package包/类
@NotNull
@Override
public ErrorCollection validate(@NotNull BuildConfiguration buildConfiguration) {
ErrorCollection errors = super.validate(buildConfiguration);
String url = buildConfiguration.getString(WEB_REPOSITORY_URL, "");
if (url.isEmpty()) {
errors.addError("webRepositoryUrl", "This field is required");
} else if (!UrlUtils.verifyHierachicalURI(url)) {
errors.addError("webRepositoryUrl", "This is not a valid URL");
}
return errors;
}
示例5: validate
import com.atlassian.bamboo.utils.error.ErrorCollection; //导入方法依赖的package包/类
@Override
public void validate(@NotNull ActionParametersMap params, @NotNull ErrorCollection errorCollection)
{
super.validate(params, errorCollection);
if (StringUtils.isEmpty(params.getString(CheckStyleTaskConfigurator.CHECKSTYLE_PATH)))
{
errorCollection.addError(CheckStyleTaskConfigurator.CHECKSTYLE_PATH, "Please specify the directory containing the XML CheckStyle output files.");
}
}
示例6: validate
import com.atlassian.bamboo.utils.error.ErrorCollection; //导入方法依赖的package包/类
@Override
public void validate(@NotNull final ActionParametersMap params,
@NotNull final ErrorCollection errorCollection) {
super.validate(params, errorCollection);
final String hammerValue = params.getString("hammer");
if (StringUtils.isEmpty(hammerValue)) {
errorCollection.addError("hammer",
textProvider.getText("daticaldb.hammer.error"));
}
final String driversValue = params.getString("drivers");
if (StringUtils.isEmpty(driversValue)) {
errorCollection.addError("drivers",
textProvider.getText("daticaldb.drivers.error"));
}
final String projectDirValue = params.getString("projectDir");
if (StringUtils.isEmpty(projectDirValue)) {
errorCollection.addError("projectDir",
textProvider.getText("daticaldb.projectDir.error"));
}
final String commandValue = params.getString("projectDir");
if (StringUtils.isEmpty(commandValue)) {
errorCollection.addError("command",
textProvider.getText("daticaldb.command.error"));
}
}
示例7: validate
import com.atlassian.bamboo.utils.error.ErrorCollection; //导入方法依赖的package包/类
@Override
public void validate(@NotNull final ActionParametersMap params, @NotNull final ErrorCollection errorCollection) {
super.validate(params, errorCollection);
// TextProvider textprovider = TextProviderUtils.getTextProvider();
I18nBean i18nBean = this.getI18nBean();
final String gradleTaskValue = params.getString("gradleTask");
if (StringUtils.isEmpty(gradleTaskValue)) {
// errorCollection.addError("gradleTask", textprovider.getText("gradle.task.error"));
errorCollection.addError("gradleTask", i18nBean.getText("gradle.task.error"));
}
}
示例8: validate
import com.atlassian.bamboo.utils.error.ErrorCollection; //导入方法依赖的package包/类
@Override
public void validate(@NotNull final ActionParametersMap params, @NotNull final ErrorCollection errorCollection)
{
super.validate(params, errorCollection);
final String server = params.getString(HOST);
if (StringUtils.isEmpty(server))
{
errorCollection.addError(HOST, textProvider.getText("vm.server.error"));
}
final String username = params.getString(USERNAME);
if (StringUtils.isEmpty(username))
{
errorCollection.addError(USERNAME, textProvider.getText("vm.username.error"));
}
if ("true".equals(params.getString(CHANGE_PASSWORD)))
{
String password = params.getString(PLAIN_PASSWORD);
if (StringUtils.isEmpty(password))
{
errorCollection.addError(PLAIN_PASSWORD, textProvider.getText("vm.password.error"));
}
}
final String name = params.getString(NAME);
if (StringUtils.isEmpty(name))
{
errorCollection.addError(NAME, textProvider.getText("vm.name.error"));
}
}
示例9: validateRequired
import com.atlassian.bamboo.utils.error.ErrorCollection; //导入方法依赖的package包/类
private void validateRequired(ActionParametersMap params, ErrorCollection errorCollection, String field) {
String value = params.getString(field);
if (value == null || value.trim().isEmpty())
errorCollection.addError(field, i18nBean.getText("err." + field)); //$NON-NLS-1$
}
示例10: validateNumber
import com.atlassian.bamboo.utils.error.ErrorCollection; //导入方法依赖的package包/类
private void validateNumber(ActionParametersMap params, ErrorCollection errorCollection, String field) {
String value = params.getString(field);
if (!("".equals(value) || StringUtils.isNumeric(value))) //$NON-NLS-1$
errorCollection.addError(field, i18nBean.getText("err.nan")); //$NON-NLS-1$
}
示例11: validate
import com.atlassian.bamboo.utils.error.ErrorCollection; //导入方法依赖的package包/类
@Override
public void validate(final ActionParametersMap params, final ErrorCollection errorCollection) {
super.validate(params, errorCollection);
final String projectName = params.getString(HubScanConfigFieldEnum.PROJECT.getKey());
final String versionName = params.getString(HubScanConfigFieldEnum.VERSION.getKey());
final String phase = params.getString(HubScanConfigFieldEnum.PHASE.getKey());
final String distribution = params.getString(HubScanConfigFieldEnum.DISTRIBUTION.getKey());
final String scanMemory = params.getString(HubScanConfigFieldEnum.SCANMEMORY.getKey());
final String bomWaitTime = params.getString(HubScanConfigFieldEnum.MAX_WAIT_TIME_FOR_BOM_UPDATE.getKey());
final String scanTargetText = params.getString(HubScanConfigFieldEnum.TARGETS.getKey());
final String excludePatternsString = params.getString(HubScanConfigFieldEnum.EXCLUDE_PATTERNS.getKey());
List<String> scanTargets = new ArrayList<>();
try {
scanTargets = HubBambooUtils.getInstance().createScanTargetPaths(scanTargetText, null);
} catch (final IOException e) {
errorCollection.addError(HubScanConfigFieldEnum.TARGETS.getKey(), e.getMessage());
}
final String[] excludePatterns = HubBambooUtils.getInstance().createExcludePatterns(excludePatternsString);
final ProjectRequestValidator projectRequestValidator = new ProjectRequestValidator();
projectRequestValidator.setProjectName(projectName);
projectRequestValidator.setVersionName(versionName);
projectRequestValidator.setPhase(phase);
projectRequestValidator.setDistribution(distribution);
final ValidationResults projectRequesResult = projectRequestValidator.assertValid();
if (!projectRequesResult.isSuccess()) {
checkValidationErrors(HubScanConfigFieldEnum.PROJECT, projectRequesResult, errorCollection);
checkValidationErrors(HubScanConfigFieldEnum.VERSION, projectRequesResult, errorCollection);
checkValidationErrors(HubScanConfigFieldEnum.PHASE, projectRequesResult, errorCollection);
checkValidationErrors(HubScanConfigFieldEnum.DISTRIBUTION, projectRequesResult, errorCollection);
}
final HubScanConfigValidator hubScanJobConfigValidator = new HubScanConfigValidator();
hubScanJobConfigValidator.setScanMemory(scanMemory);
hubScanJobConfigValidator.addAllScanTargetPaths(new HashSet<>(scanTargets));
hubScanJobConfigValidator.disableScanTargetPathExistenceCheck();
final ValidationResults scanConfigResult = hubScanJobConfigValidator.assertValid();
validateExcludePatterns(scanConfigResult, excludePatterns);
if (!scanConfigResult.isSuccess()) {
checkValidationErrors(HubScanConfigFieldEnum.MAX_WAIT_TIME_FOR_BOM_UPDATE, scanConfigResult, errorCollection);
checkValidationErrors(HubScanConfigFieldEnum.SCANMEMORY, scanConfigResult, errorCollection);
if (!scanTargets.isEmpty()) {
checkValidationErrors(HubScanConfigFieldEnum.TARGETS, scanConfigResult, errorCollection);
}
}
checkValidationErrors(HubScanConfigFieldEnum.EXCLUDE_PATTERNS, scanConfigResult, errorCollection);
checkBomWaitTime(bomWaitTime, errorCollection);
}
示例12: validate
import com.atlassian.bamboo.utils.error.ErrorCollection; //导入方法依赖的package包/类
@Override
public void validate(@NotNull final ActionParametersMap params, @NotNull final ErrorCollection errorCollection)
{
super.validate(params, errorCollection);
final String host = params.getString("host");
if (StringUtils.isEmpty(host))
{
errorCollection.addError("host", textProvider.getText("xbdd.host.error"));
}
if (host != null && !host.contains("http")) {
errorCollection.addError("host", textProvider.getText("xbdd.http.error"));
}
final String path1Value = params.getString("path");
if (StringUtils.isEmpty(path1Value))
{
errorCollection.addError("path", textProvider.getText("xbdd.path.error"));
}
final String build = params.getString("plug-build");
if (StringUtils.isEmpty(build))
{
errorCollection.addError("plug-build", textProvider.getText("xbdd.build.error"));
}
final String productName = params.getString("product");
if (StringUtils.isEmpty(productName))
{
errorCollection.addError("product", textProvider.getText("xbdd.product.error"));
}
final String[] versionFields = {"major", "minor", "servicepack"};
for (String field : versionFields) {
try {
final Integer fieldVal = Integer.parseInt(params.getString(field));
if (StringUtils.isEmpty(params.getString(field)) || fieldVal < 0) {
errorCollection.addError(field, textProvider.getText("xbdd.version.error"));
}
} catch (Exception e) {
errorCollection.addError(field, textProvider.getText("XBDD.version.error"));
}
}
}