You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BusinessRulesValidation.aj 664B

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