- 授权协议: EPL
- 开发语言: Java
- 操作系统: 跨平台
- 软件首页: http://oval.sourceforge.net/
- 软件文档: http://oval.sourceforge.net/userguide.html
软件介绍
OVal 是一个可扩展的Java对象数据验证框架,验证的规则可以通过配置文件、Annotation、POJOs 进行设定。可以使用纯 Java 语言、JavaScript 、Groovy 、BeanShell 等进行规则的编写。
示例代码:
private static class TestEntity
{
@Min(1960)
private int year = 1977;
@Range(min=1, max=12)
private int month = 2;
@ValidateWithMethod(methodName = "isValidDay", parameterType = int.class)
private int day = 31;
private boolean isValidDay(int day)
{
GregorianCalendar cal = new GregorianCalendar();
cal.setLenient(false);
cal.set(GregorianCalendar.YEAR, year);
cal.set(GregorianCalendar.MONTH, month - 1);
cal.set(GregorianCalendar.DATE, day);
try {
cal.getTimeInMillis(); // throws IllegalArgumentException
} catch (IllegalArgumentException e) {
return false;
}
return true;
}
}
Design systems
Not all design systems are equally effective. Some can generate coherent user experiences, others produce confusing patchwork designs. Some inspire teams to contribute to them, others are neglected. S......一起来看看 《Design systems》 这本书的介绍吧!
