added messageArgument aware method
This commit is contained in:
parent
4cd4044a0e
commit
2a2d9575e5
|
@ -279,6 +279,8 @@ public class BaseValidator {
|
||||||
* Set this parameter to <code>false</code> if the validation does not pass
|
* Set this parameter to <code>false</code> if the validation does not pass
|
||||||
* @return Returns <code>thePass</code> (in other words, returns <code>true</code> if the rule did not fail validation)
|
* @return Returns <code>thePass</code> (in other words, returns <code>true</code> if the rule did not fail validation)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//todo: delete this when finished i18n
|
||||||
protected boolean rule(List<ValidationMessage> errors, IssueType type, String path, boolean thePass, String msg) {
|
protected boolean rule(List<ValidationMessage> errors, IssueType type, String path, boolean thePass, String msg) {
|
||||||
if (!thePass) {
|
if (!thePass) {
|
||||||
addValidationMessage(errors, type, -1, -1, path, msg, IssueSeverity.ERROR);
|
addValidationMessage(errors, type, -1, -1, path, msg, IssueSeverity.ERROR);
|
||||||
|
@ -286,6 +288,14 @@ public class BaseValidator {
|
||||||
return thePass;
|
return thePass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean rule(List<ValidationMessage> errors, IssueType type, String path, boolean thePass, String theMessage, Object... theMessageArguments) {
|
||||||
|
if (!thePass) {
|
||||||
|
String message = formatMessage(theMessage, theMessageArguments);
|
||||||
|
addValidationMessage(errors, type, -1, -1, path, message, IssueSeverity.ERROR);
|
||||||
|
}
|
||||||
|
return thePass;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean rule(List<ValidationMessage> errors, Source source, IssueType type, String path, boolean thePass, String msg) {
|
public boolean rule(List<ValidationMessage> errors, Source source, IssueType type, String path, boolean thePass, String msg) {
|
||||||
if (!thePass) {
|
if (!thePass) {
|
||||||
addValidationMessage(errors, type, -1, -1, path, msg, IssueSeverity.ERROR, source);
|
addValidationMessage(errors, type, -1, -1, path, msg, IssueSeverity.ERROR, source);
|
||||||
|
|
Loading…
Reference in New Issue