[hibernate-commits] Hibernate SVN: r15494 - 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 22:12:55 EST 2008


Author: epbernard
Date: 2008-11-03 22:12:55 -0500 (Mon, 03 Nov 2008)
New Revision: 15494

Removed:
   validator/trunk/validation-api/src/main/java/javax/validation/StandardConstraint.java
   validator/trunk/validation-api/src/main/java/javax/validation/StandardConstraintDescriptor.java
Modified:
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/LengthConstraint.java
Log:
Remove obsolete StandardConstraint(Descriptor)

Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/LengthConstraint.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/LengthConstraint.java	2008-11-04 02:37:22 UTC (rev 15493)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/LengthConstraint.java	2008-11-04 03:12:55 UTC (rev 15494)
@@ -18,8 +18,6 @@
 package org.hibernate.validation.constraints;
 
 import javax.validation.Constraint;
-import javax.validation.StandardConstraint;
-import javax.validation.StandardConstraintDescriptor;
 import javax.validation.ConstraintContext;
 
 /**
@@ -28,7 +26,7 @@
  * @author Emmanuel Bernard
  * @author Gavin King
  */
-public class LengthConstraint implements Constraint<Length>, StandardConstraint {
+public class LengthConstraint implements Constraint<Length> {
 	private int min;
 	private int max;
 
@@ -49,16 +47,4 @@
 		return length >= min && length <= max;
 	}
 
-	public StandardConstraintDescriptor getStandardConstraints() {
-		return new StandardConstraintDescriptor() {
-			public Integer getLength() {
-				if ( max == Integer.MAX_VALUE ) {
-					return null;
-				}
-				else {
-					return max;
-				}
-			}
-		};
-	}
 }

Deleted: validator/trunk/validation-api/src/main/java/javax/validation/StandardConstraint.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/StandardConstraint.java	2008-11-04 02:37:22 UTC (rev 15493)
+++ validator/trunk/validation-api/src/main/java/javax/validation/StandardConstraint.java	2008-11-04 03:12:55 UTC (rev 15494)
@@ -1,32 +0,0 @@
-// $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;
-
-/**
- * Define the constraint influence on standard constraint dimensions
- *
- * @author Emmanuel Bernard
- * @author Hardy Ferentschik
- */
-public interface StandardConstraint {
-	/**
-	 * returns the StandardConstraintDescriptor initialized according to the
-	 * constraint validator
-	 */
-	StandardConstraintDescriptor getStandardConstraints();
-}

Deleted: validator/trunk/validation-api/src/main/java/javax/validation/StandardConstraintDescriptor.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/StandardConstraintDescriptor.java	2008-11-04 02:37:22 UTC (rev 15493)
+++ validator/trunk/validation-api/src/main/java/javax/validation/StandardConstraintDescriptor.java	2008-11-04 03:12:55 UTC (rev 15494)
@@ -1,63 +0,0 @@
-// $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;
-
-/**
- * Describe how the current constraint influences the standard constraints.
- *
- * @author Emmanuel Bernard
- * @author Hardy Ferentschik
- */
-public class StandardConstraintDescriptor {
-	/**
-	 * Defines the object nullability.
-	 *
-	 * @return <code>TRUE<code> if the object is nullable, <code>FALSE</code> if object is not
-	 *         nullable and <code>null</code> if nullabiltiy does not apply.
-	 */
-	public Boolean getNullability() {
-		return null;
-	}
-
-	/**
-	 * Defines the precision if the validated object is a number.
-	 *
-	 * @return the number's precision or <code>null</code> if precision does not apply.
-	 */
-	public Integer getPrecision() {
-		return null;
-	}
-
-	/**
-	 * Defines the scale if the validated object is a number.
-	 *
-	 * @return the number's scale or <code>null</code> if scale does not apply.
-	 */
-	public Integer getScale() {
-		return null;
-	}
-
-	/**
-	 * Defines the length if the validated object is a string.
-	 *
-	 * @return the strings's length or <code>null</code> if length does not apply.
-	 */
-	public Integer getLength() {
-		return null;
-	}
-}




More information about the hibernate-commits mailing list