1 19 20 package org.apache.cayenne.validation; 21 22 import org.apache.cayenne.CayenneRuntimeException; 23 24 30 public class ValidationException extends CayenneRuntimeException { 31 32 private ValidationResult result; 33 34 public ValidationException(String message) { 35 super(message); 36 } 37 38 public ValidationException(ValidationResult result) { 39 this("Validation has failed.", result); 40 } 41 42 public ValidationException(String message, ValidationResult result) { 43 super(message); 44 this.result = result; 45 } 46 47 public ValidationResult getValidationResult() { 48 return result; 49 } 50 51 public String toString() { 52 return super.toString() + System.getProperty("line.separator") + this.result; 53 } 54 } 55 | Popular Tags |