Example:
public class Person { private String name; @NotNull public String getName() { return name; } public void setName(String name) { this.name = name; } } public class FormBase<T> { private T item; @Valid public T getItem() { return item; } public void setItem(T item) { this.item = item; } } public class PersonForm extends FormBase<Person> { }
The expected Result (represented as XML) would look like:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <metaData xmlns="http://www.appng.org/schema/platform" binding="item" bindClass="org.appng.exaple.PersonForm"> <field name="name" type="text" binding="item.name"> <validation> <notNull> <message ref="item.name" class="ERROR" code="{javax.validation.constraints.NotNull.message}">must not be null</message> </notNull> </validation> </field> </metaData>