blob: b733b110a18d0ec9006c45187ce94ad1c9ed7324 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
package insurance.model.validation;
import java.util.*;
import insurance.model.*;
public aspect BusinessRulesValidation {
private Map validatorsByType = new HashMap();
// RequiresValidation interface
public interface RequiresValidation {}
public List RequiresValidation.getValidationErrors() {
if (this.validationErrors == null) {
this.validationErrors = new ArrayList();
}
return validationErrors;
}
private List RequiresValidation.validationErrors;
// Triggering validation
void foo(RequiresValidation domainObject) {
throw new SIValidationException(
domainObject, domainObject.getValidationErrors());
}
}
|