final Proxy firstNameProxy = root.getPropertyProxy(Person.FIRST_NAME);
final Proxy lastNameProxy = root.getPropertyProxy(Person.LAST_NAME);
final Proxy ageProxy = root.getPropertyProxy(Person.AGE);
final Proxy addressProxy = root.getPropertyProxy(Person.ADDRESS);
final ProxyDiagnostic firstNameDiagnostic = new ProxyDiagnosticImpl(
DiagnosticLevel.ERROR,
firstNameProxy,
modelFactory.createMessage("not.set", "firstName"));
final ProxyDiagnostic lastNameDiagnostic = new ProxyDiagnosticImpl(
DiagnosticLevel.ERROR,
lastNameProxy,
modelFactory.createMessage("not.set", "lastName"));
final ProxyDiagnostic ageDiagnostic = new ProxyDiagnosticImpl(
DiagnosticLevel.ERROR,
ageProxy,
modelFactory.createMessage(
"out.of.range",
new Object[]{
new Integer(0),
new Integer(100000),
new Integer(-10)
}));
final ProxyDiagnostic addressDiagnostic = new ProxyDiagnosticImpl(
DiagnosticLevel.ERROR,
addressProxy,
modelFactory.createMessage("not.set", "address"));
// Check the diagnostics on the proxies for the properties.