commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r829287 - /commons/sandbox/validator2/branches/alternative/validation-api/src/main/java/javax/validation/ConstraintViolationException.java
Date Sat, 24 Oct 2009 00:16:32 GMT
Author: niallp
Date: Sat Oct 24 00:16:32 2009
New Revision: 829287

URL: http://svn.apache.org/viewvc?rev=829287&view=rev
Log:
Fix ConstraintViolationException API

Modified:
    commons/sandbox/validator2/branches/alternative/validation-api/src/main/java/javax/validation/ConstraintViolationException.java

Modified: commons/sandbox/validator2/branches/alternative/validation-api/src/main/java/javax/validation/ConstraintViolationException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/validator2/branches/alternative/validation-api/src/main/java/javax/validation/ConstraintViolationException.java?rev=829287&r1=829286&r2=829287&view=diff
==============================================================================
--- commons/sandbox/validator2/branches/alternative/validation-api/src/main/java/javax/validation/ConstraintViolationException.java
(original)
+++ commons/sandbox/validator2/branches/alternative/validation-api/src/main/java/javax/validation/ConstraintViolationException.java
Sat Oct 24 00:16:32 2009
@@ -16,6 +16,8 @@
  */
 package javax.validation;
 
+import java.util.Set;
+
 /**
  * Constraint Violation Exception.
  *
@@ -26,37 +28,35 @@
 
     private static final long serialVersionUID = 1L;
 
-    /**
-     * Construct an exception with no message or cause.
-     */
-    public ConstraintViolationException() {
-    }
+    private final Set<ConstraintViolation<?>> violations;
 
     /**
-     * Construct an exception with a message but no cause.
+     * Construct an exception with the constraint violations.
      *
-     * @param message The error message
+     * @param violations The constraint violations
      */
-    public ConstraintViolationException(String message) {
-        super(message);
+    public ConstraintViolationException(Set<ConstraintViolation<?>> violations)
{
+        super();
+        this.violations = violations;
     }
 
     /**
-     * Construct an exception with a message and cause.
+     * Construct an exception with a message and the constraint violations.
      *
      * @param message The error message
-     * @param cause The root cause of the exception
+     * @param violations The constraint violations
      */
-    public ConstraintViolationException(String message, Throwable cause) {
-        super(message, cause);
+    public ConstraintViolationException(String message, Set<ConstraintViolation<?>>
violations) {
+        super(message);
+        this.violations = violations;
     }
 
     /**
-     * Construct an exception with a cause but no message.
+     * Return the constraint violations.
      *
-     * @param cause The root cause of the exception
+     * @return the constraint violations
      */
-    public ConstraintViolationException(Throwable cause) {
-        super(cause);
+    public Set<ConstraintViolation<?>> getConstraintViolations() {
+        return violations;
     }
 }



Mime
View raw message