@Test public void compositeEditor() { class EmailModel extends AbstractPM { @Property TextPM to = new TextPM(); @Property TextPM from = new TextPM(); public EmailModel() { to.setMandatory(true); from.setMandatory(true); PMManager.setup(this); } @Validation(path = "to", message = "missing '@'") boolean toContainsAt() { return to.getText().indexOf('@') >= 0; } @Validation(path = "from", message = "missing '@'") boolean fromContainsAt() { return from.getText().indexOf('@') >= 0; } } EmailModel pModel = new EmailModel(); assertEquals("pModel.isValid()", false, pModel.isValid()); pModel.to.setText("hallo"); pModel.from.setText("hallo"); assertEquals("pModel.isValid()", false, pModel.isValid()); pModel.to.setText("tom@example.com"); assertEquals("pModel.to.isValid()", true, pModel.to.isValid()); assertEquals("pModel.isValid()", false, pModel.isValid()); pModel.from.setText("jerry@example.com"); assertEquals("pModel.from.isValid()", true, pModel.from.isValid()); assertEquals("pModel.isValid()", true, pModel.isValid()); }
public void setup(Method method) { if (map.containsKey(method) == false) { ValidationMethodSupport support = support(model, method, resourceBundle); map.put(method, support); } }
ValidationSupport implements Support { public void setup(Method method) { if (map.containsKey(method) == false) { ValidationMethodSupport support = support(model, method, resourceBundle); map.put(method, support); } } }
ValidationSupport implements Support { public void setup(Method method) { if (map.containsKey(method) == false) { ValidationMethodSupport support = support(model, method, resourceBundle); map.put(method, support); } } private  ValidationSupport(PresentationModel model); }
ValidationSupport implements Support { public void setup(Method method) { if (map.containsKey(method) == false) { ValidationMethodSupport support = support(model, method, resourceBundle); map.put(method, support); } } private  ValidationSupport(PresentationModel model); static ValidationSupport get(PresentationModel model); void setup(Method method); }
ValidationSupport implements Support { public void setup(Method method) { if (map.containsKey(method) == false) { ValidationMethodSupport support = support(model, method, resourceBundle); map.put(method, support); } } private  ValidationSupport(PresentationModel model); static ValidationSupport get(PresentationModel model); void setup(Method method);  }