本文整理了Java中hudson.model.Messages.Hudson_NotANumber()
方法的一些代码示例,展示了Messages.Hudson_NotANumber()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Messages.Hudson_NotANumber()
方法的具体详情如下:
包路径:hudson.model.Messages
类名称:Messages
方法名:Hudson_NotANumber
[英]Not a number
[中]不是数字
代码示例来源:origin: jenkinsci/jenkins
/**
* Makes sure that the given string is a positive integer.
*/
public static FormValidation validatePositiveInteger(String value) {
try {
if(Integer.parseInt(value)<=0)
return error(hudson.model.Messages.Hudson_NotAPositiveNumber());
return ok();
} catch (NumberFormatException e) {
return error(hudson.model.Messages.Hudson_NotANumber());
}
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Makes sure that the given string is a non-negative integer.
*/
public static FormValidation validateNonNegativeInteger(String value) {
try {
if(Integer.parseInt(value)<0)
return error(hudson.model.Messages.Hudson_NotANonNegativeNumber());
return ok();
} catch (NumberFormatException e) {
return error(hudson.model.Messages.Hudson_NotANumber());
}
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Make sure that the given string is an integer in the range specified by the lower and upper bounds (both inclusive)
*
* @param value the value to check
* @param lower the lower bound (inclusive)
* @param upper the upper bound (inclusive)
*
* @since 2.104
*/
public static FormValidation validateIntegerInRange(String value, int lower, int upper) {
try {
int intValue = Integer.parseInt(value);
if (intValue < lower) {
return error(hudson.model.Messages.Hudson_MustBeAtLeast(lower));
}
if (intValue > upper) {
return error(hudson.model.Messages.Hudson_MustBeAtMost(upper));
}
return ok();
} catch (NumberFormatException e) {
return error(hudson.model.Messages.Hudson_NotANumber());
}
}
代码示例来源:origin: jenkinsci/jenkins
return FormValidation.error(Messages.Hudson_NotANumber());
代码示例来源:origin: jenkinsci/jenkins
/**
* Performs on-the-fly validation of the errorlevel.
*/
@Restricted(DoNotUse.class)
public FormValidation doCheckUnstableReturn(@QueryParameter String value) {
value = Util.fixEmptyAndTrim(value);
if (value == null) {
return FormValidation.ok();
}
long unstableReturn;
try {
unstableReturn = Long.parseLong(value);
} catch (NumberFormatException e) {
return FormValidation.error(hudson.model.Messages.Hudson_NotANumber());
}
if (unstableReturn == 0) {
return FormValidation.warning(hudson.tasks.Messages.BatchFile_invalid_exit_code_zero());
}
if (unstableReturn < Integer.MIN_VALUE || unstableReturn > Integer.MAX_VALUE) {
return FormValidation.error(hudson.tasks.Messages.BatchFile_invalid_exit_code_range(unstableReturn));
}
return FormValidation.ok();
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Performs on-the-fly validation of the exit code.
*/
@Restricted(DoNotUse.class)
public FormValidation doCheckUnstableReturn(@QueryParameter String value) {
value = Util.fixEmptyAndTrim(value);
if (value == null) {
return FormValidation.ok();
}
long unstableReturn;
try {
unstableReturn = Long.parseLong(value);
} catch (NumberFormatException e) {
return FormValidation.error(hudson.model.Messages.Hudson_NotANumber());
}
if (unstableReturn == 0) {
return FormValidation.warning(hudson.tasks.Messages.Shell_invalid_exit_code_zero());
}
if (unstableReturn < 1 || unstableReturn > 255) {
return FormValidation.error(hudson.tasks.Messages.Shell_invalid_exit_code_range(unstableReturn));
}
return FormValidation.ok();
}
代码示例来源:origin: jenkinsci/jenkins
protected void check() throws IOException, ServletException {
try {
String value = request.getParameter("value");
if(Integer.parseInt(value)<0)
error(hudson.model.Messages.Hudson_NotAPositiveNumber());
else
ok();
} catch (NumberFormatException e) {
error(hudson.model.Messages.Hudson_NotANumber());
}
}
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* Makes sure that the given string is a positive integer.
*/
public static FormValidation validatePositiveInteger(String value) {
try {
if(Integer.parseInt(value)<=0)
return error(hudson.model.Messages.Hudson_NotAPositiveNumber());
return ok();
} catch (NumberFormatException e) {
return error(hudson.model.Messages.Hudson_NotANumber());
}
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Makes sure that the given string is a non-negative integer.
*/
public static FormValidation validateNonNegativeInteger(String value) {
try {
if(Integer.parseInt(value)<0)
return error(hudson.model.Messages.Hudson_NotANonNegativeNumber());
return ok();
} catch (NumberFormatException e) {
return error(hudson.model.Messages.Hudson_NotANumber());
}
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Makes sure that the given string is a positive integer.
*/
public static FormValidation validatePositiveInteger(String value) {
try {
if(Integer.parseInt(value)<=0)
return error(hudson.model.Messages.Hudson_NotAPositiveNumber());
return ok();
} catch (NumberFormatException e) {
return error(hudson.model.Messages.Hudson_NotANumber());
}
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Makes sure that the given string is a positive integer.
*/
public static FormValidation validatePositiveInteger(String value) {
try {
if(Integer.parseInt(value)<=0)
return error(hudson.model.Messages.Hudson_NotAPositiveNumber());
return ok();
} catch (NumberFormatException e) {
return error(hudson.model.Messages.Hudson_NotANumber());
}
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* Makes sure that the given string is a non-negative integer.
*/
public static FormValidation validateNonNegativeInteger(String value) {
try {
if(Integer.parseInt(value)<0)
return error(hudson.model.Messages.Hudson_NotANonNegativeNumber());
return ok();
} catch (NumberFormatException e) {
return error(hudson.model.Messages.Hudson_NotANumber());
}
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Makes sure that the given string is a non-negative integer.
*/
public static FormValidation validateNonNegativeInteger(String value) {
try {
if(Integer.parseInt(value)<0)
return error(hudson.model.Messages.Hudson_NotANonNegativeNumber());
return ok();
} catch (NumberFormatException e) {
return error(hudson.model.Messages.Hudson_NotANumber());
}
}
代码示例来源:origin: hudson/hudson-2.x
/**
* Makes sure that the given string is a non-negative integer.
*/
public static FormValidation validateNonNegativeInteger(String value) {
try {
if(Integer.parseInt(value)<0)
return error(hudson.model.Messages.Hudson_NotANonNegativeNumber());
return ok();
} catch (NumberFormatException e) {
return error(hudson.model.Messages.Hudson_NotANumber());
}
}
代码示例来源:origin: hudson/hudson-2.x
/**
* Makes sure that the given string is a positive integer.
*/
public static FormValidation validatePositiveInteger(String value) {
try {
if(Integer.parseInt(value)<=0)
return error(hudson.model.Messages.Hudson_NotAPositiveNumber());
return ok();
} catch (NumberFormatException e) {
return error(hudson.model.Messages.Hudson_NotANumber());
}
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* Makes sure that the given string is a positive integer.
*/
public static FormValidation validatePositiveInteger(String value) {
try {
if (Integer.parseInt(value) <= 0) {
return error(hudson.model.Messages.Hudson_NotAPositiveNumber());
}
return ok();
} catch (NumberFormatException e) {
return error(hudson.model.Messages.Hudson_NotANumber());
}
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
protected void check() throws IOException, ServletException {
try {
String value = request.getParameter("value");
if(Integer.parseInt(value)<0)
error(hudson.model.Messages.Hudson_NotAPositiveNumber());
else
ok();
} catch (NumberFormatException e) {
error(hudson.model.Messages.Hudson_NotANumber());
}
}
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
protected void check() throws IOException, ServletException {
try {
String value = request.getParameter("value");
if(Integer.parseInt(value)<0)
error(hudson.model.Messages.Hudson_NotAPositiveNumber());
else
ok();
} catch (NumberFormatException e) {
error(hudson.model.Messages.Hudson_NotANumber());
}
}
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
protected void check() throws IOException, ServletException {
try {
String value = request.getParameter("value");
if(Integer.parseInt(value)<0)
error(hudson.model.Messages.Hudson_NotAPositiveNumber());
else
ok();
} catch (NumberFormatException e) {
error(hudson.model.Messages.Hudson_NotANumber());
}
}
}
代码示例来源:origin: hudson/hudson-2.x
protected void check() throws IOException, ServletException {
try {
String value = request.getParameter("value");
if(Integer.parseInt(value)<0)
error(hudson.model.Messages.Hudson_NotAPositiveNumber());
else
ok();
} catch (NumberFormatException e) {
error(hudson.model.Messages.Hudson_NotANumber());
}
}
}
内容来源于网络,如有侵权,请联系作者删除!