
org.xson.common.validate.rule.StringNoMatchChecker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xco-validate Show documentation
Show all versions of xco-validate Show documentation
xco-validate based XCO, using xml language to describe data validation framework.
The newest version!
package org.xson.common.validate.rule;
import java.util.regex.Pattern;
import org.xson.common.object.XCO;
import org.xson.common.validate.Checker;
/**
* 字符串不匹配校验校验
*/
public class StringNoMatchChecker implements Checker {
@Override
public boolean check(XCO xco, String fieldName, Object value) {
Pattern pattern = (Pattern) value;
String val = xco.getStringValue(fieldName);
return !pattern.matcher(val).matches();
}
public static Object parseValue(String value) {
return Pattern.compile(value.trim());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy