
com.ktanx.common.validation.RegexValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ktanx-common Show documentation
Show all versions of ktanx-common Show documentation
Ktanx is a java development kit.
The newest version!
package com.ktanx.common.validation;
/**
* Created by liyd on 17/1/24.
*/
public class RegexValidator implements Validator {
public boolean validate(Object value) {
String[] values = (String[]) value;
return values[0].matches(values[1]);
}
public String validateCode() {
return "regex.error";
}
public String validateMsg(Object value, String validateName) {
return validateName + "格式不正确";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy