shihyuho / validation

Some sample to do the validating things, like implementation of JSR-303

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Validation

Some sample to do the validating things

JSR-303

package org.shihyu.validation.jsr303

Intergration with JEXL java expression language

@AssertThat(
	value = "this.age >= 18 || (this.age < 18  && not empty(this.parent))",
    propertyNode = "age")
@Getter
@Setter
public class MyBean {
	private int age;
	private String parent;
	@AssertThat("this != null && this.isAfter(forName('java.time.LocalDate').now().plusDays(7))")
	private LocalDate expire;
	// ...
}

About

Some sample to do the validating things, like implementation of JSR-303


Languages

Language:Java 100.0%