[hibernate-commits] Hibernate SVN: r15489 - in validator/trunk: validation-api/src/main/java/javax/validation and 1 other directory.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Mon Nov 3 17:32:21 EST 2008


Author: epbernard
Date: 2008-11-03 17:32:21 -0500 (Mon, 03 Nov 2008)
New Revision: 15489

Added:
   validator/trunk/validation-api/src/main/java/javax/validation/ReportAsViolationFromCompositeConstraint.java
Removed:
   validator/trunk/validation-api/src/main/java/javax/validation/Context.java
Modified:
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ConstraintDescriptorImpl.java
   validator/trunk/validation-api/src/main/java/javax/validation/ConstraintDescriptor.java
Log:
Rename @ReportAsViolationFromComposingConstraint to @ReportAsViolationFromCompositeConstraint

Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ConstraintDescriptorImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ConstraintDescriptorImpl.java	2008-11-03 21:35:45 UTC (rev 15488)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ConstraintDescriptorImpl.java	2008-11-03 22:32:21 UTC (rev 15489)
@@ -28,7 +28,7 @@
 import java.util.Set;
 import javax.validation.Constraint;
 import javax.validation.ConstraintDescriptor;
-import javax.validation.ReportAsViolationFromComposingConstraint;
+import javax.validation.ReportAsViolationFromCompositeConstraint;
 import javax.validation.ValidationException;
 
 /**
@@ -55,7 +55,7 @@
 		this.constraintImplementation = validator;
 		this.parameters = getAnnotationParameters( annotation );
 		this.isReportAsSingleInvalidConstraint = annotation.annotationType().isAnnotationPresent(
-				ReportAsViolationFromComposingConstraint.class
+				ReportAsViolationFromCompositeConstraint.class
 		);
 		this.constraintClass = constraintClass;
 	}
@@ -114,7 +114,7 @@
 	/**
 	 * {@inheritDoc}
 	 */
-	public boolean ReportAsViolationFromComposingConstraint() {
+	public boolean isReportAsViolationFromCompositeConstraint() {
 		return isReportAsSingleInvalidConstraint;
 	}
 

Modified: validator/trunk/validation-api/src/main/java/javax/validation/ConstraintDescriptor.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/ConstraintDescriptor.java	2008-11-03 21:35:45 UTC (rev 15488)
+++ validator/trunk/validation-api/src/main/java/javax/validation/ConstraintDescriptor.java	2008-11-03 22:32:21 UTC (rev 15489)
@@ -68,7 +68,7 @@
 	Set<ConstraintDescriptor> getComposingConstraints();
 
 	/**
-	 * @return true if the constraint is annotated with @ReportAsSingleInvalidConstraint
+	 * @return true if the constraint is annotated with @ReportAsViolationFromCompositeConstraint
 	 */
-	boolean ReportAsViolationFromComposingConstraint();
+	boolean isReportAsViolationFromCompositeConstraint();
 }

Deleted: validator/trunk/validation-api/src/main/java/javax/validation/Context.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/Context.java	2008-11-03 21:35:45 UTC (rev 15488)
+++ validator/trunk/validation-api/src/main/java/javax/validation/Context.java	2008-11-03 22:32:21 UTC (rev 15489)
@@ -1,55 +0,0 @@
-package javax.validation;
-
-/**
- * Provide contextual data and operation when applying a given constraint implementation
- *
- * @author Emmanuel Bernard
- */
-public interface Context {
-	/**
-	 * Disable default error message and default ConstraintViolation object generation.
-	 * Useful to set a different error message or generate an ConstraintViolation based on
-	 * a different property
-	 *
-	 * @see #addError(String)
-	 * @see #addError(String, String)
-	 */
-	void disableDefaultError();
-
-	/**
-	 * return the current unexpanded default message
-	 * TODO: is it needed
-	 */
-	String getDefaultErrorMessage();
-
-	/**
-	 * Add a new unexpanded error message.
-	 * <p/>
-	 * If isValid returns false, a ConstraintViolation object will be built per error message
-	 * including the default one unless #disableDefaultErrorMEssage() has been called.
-	 * <p/>
-	 * Aside from the error message, ConstraintViolation objects generated from such a call
-	 * contains the same contextual information (root bean, path and so on)
-	 * <p/>
-	 * This method can be called multiple time. One ConstraintViolation instance per call is created.
-	 *
-	 * @param message new unexpanded error message
-	 */
-	void addError(String message);
-
-	/**
-	 * Add a new unexpanded error message to a given sub property.
-	 * <p/>
-	 * If isValid returns false, a ConstraintViolation object will be built per error message including the default one
-	 * if null apply to the current property or the bean the constraint is applied on, otherwise apply to the <code>property</code> named
-	 * <p/>
-	 * TODO exception or swallowed when bean-level instance is not present?
-	 *
-	 * @param message new unexpanded error message
-	 * @param property property name the ConstraintViolation is targeting
-	 *
-	 * @throws ValidationException when the property is not present on the bean level object
-	 */
-	void addError(String message, String property);
-
-}

Copied: validator/trunk/validation-api/src/main/java/javax/validation/ReportAsViolationFromCompositeConstraint.java (from rev 15487, validator/trunk/validation-api/src/main/java/javax/validation/ReportAsViolationFromComposingConstraint.java)
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/ReportAsViolationFromCompositeConstraint.java	                        (rev 0)
+++ validator/trunk/validation-api/src/main/java/javax/validation/ReportAsViolationFromCompositeConstraint.java	2008-11-03 22:32:21 UTC (rev 15489)
@@ -0,0 +1,35 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package javax.validation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+
+/**
+ * A constraint annotation annotated with this annotation
+ * will return the composed annotation error report if any of the composing annotations
+ * fail. The error reports of each individual composing constraint is ignored.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({ ANNOTATION_TYPE })
+ at Retention(RUNTIME)
+public @interface ReportAsViolationFromCompositeConstraint {
+}


Property changes on: validator/trunk/validation-api/src/main/java/javax/validation/ReportAsViolationFromCompositeConstraint.java
___________________________________________________________________
Name: svn:keywords
   + Id




More information about the hibernate-commits mailing list