geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1763119 - /geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/
Date Mon, 03 Oct 2016 06:42:32 GMT
Author: struberg
Date: Mon Oct  3 06:42:32 2016
New Revision: 1763119

URL: http://svn.apache.org/viewvc?rev=1763119&view=rev
Log:
GERONIMO-6555 improve bean validation documentation

Modified:
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/AssertFalse.java
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/AssertTrue.java
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/DecimalMax.java
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/DecimalMin.java
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Digits.java
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Future.java
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Max.java
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Min.java
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Null.java
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Past.java
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Size.java

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/AssertFalse.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/AssertFalse.java?rev=1763119&r1=1763118&r2=1763119&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/AssertFalse.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/AssertFalse.java
Mon Oct  3 06:42:32 2016
@@ -30,6 +30,9 @@ import static java.lang.annotation.Eleme
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
+ * Verify that the annotated element is either
+ * {@code false},  {@code Boolean.FALSE} or {@code null}.
+ *
  * @version $Rev$ $Date$
  */
 @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/AssertTrue.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/AssertTrue.java?rev=1763119&r1=1763118&r2=1763119&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/AssertTrue.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/AssertTrue.java
Mon Oct  3 06:42:32 2016
@@ -30,6 +30,9 @@ import static java.lang.annotation.Eleme
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
+ * Verify that the annotated element is either
+ * {@code true},  {@code Boolean.TRUE} or {@code null}.
+ *
  * @version $Rev$ $Date$
  */
 @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/DecimalMax.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/DecimalMax.java?rev=1763119&r1=1763118&r2=1763119&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/DecimalMax.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/DecimalMax.java
Mon Oct  3 06:42:32 2016
@@ -30,6 +30,14 @@ import static java.lang.annotation.Eleme
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
+ * Verify that the annotated element has a number which is
+ * lower or equal than the given value or is {@code null}.
+ *
+ * Note that float and double are not portably supported due to
+ * possible rounding error problems.
+ *
+ * {@link DecimalMax} accepts a String whereas {@Max} accepts a long.
+ *
  * @version $Rev$ $Date$
  */
 @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/DecimalMin.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/DecimalMin.java?rev=1763119&r1=1763118&r2=1763119&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/DecimalMin.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/DecimalMin.java
Mon Oct  3 06:42:32 2016
@@ -30,6 +30,14 @@ import static java.lang.annotation.Eleme
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
+ * Verify that the annotated element has a number which is
+ * higher or equal than the given value or is {@code null}.
+ *
+ * Note that float and double are not portably supported due to
+ * possible rounding error problems.
+ *
+ * {@link DecimalMax} accepts a String whereas {@Max} accepts a long.
+ *
  * @version $Rev$ $Date$
  */
 @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Digits.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Digits.java?rev=1763119&r1=1763118&r2=1763119&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Digits.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Digits.java
Mon Oct  3 06:42:32 2016
@@ -30,6 +30,20 @@ import static java.lang.annotation.Eleme
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
+ * Specify the number of maximal allowed digits for the fraction part and the digit size.
+ * This annotation can be applied to
+ * <ul>
+ *     <li>BigDecimal</li>
+ *     <li>BigInteger</li>
+ *     <li>String</li>
+ *     <li><byte and Byte/li>
+ *     <li><short and Short/li>
+ *     <li><int and Integer /li>
+ *     <li><long and Long/li>
+ * </ul>
+ *
+ * Float and double are not portably supported due to rounding issues.
+ *
  * @version $Rev$ $Date$
  */
 @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@@ -43,8 +57,14 @@ public @interface Digits {
 
     Class<? extends Payload>[] payload() default {};
 
+    /**
+     * @return the maximum allowed digit size
+     */
     int integer();
 
+    /**
+     * @return the maximum allowed number of fraction digits.
+     */
     int fraction();
 
     @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Future.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Future.java?rev=1763119&r1=1763118&r2=1763119&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Future.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Future.java
Mon Oct  3 06:42:32 2016
@@ -30,6 +30,11 @@ import static java.lang.annotation.Eleme
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
+ * Verify that the annotated value of the annotated element is in the future or {@code null}.
+ * Supported types are {@link java.util.Calendar} and {@link java.util.Date}
+ *
+ * Other types might be supported in a non-portable manner.
+ *
  * @version $Rev$ $Date$
  */
 @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Max.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Max.java?rev=1763119&r1=1763118&r2=1763119&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Max.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Max.java
Mon Oct  3 06:42:32 2016
@@ -30,6 +30,14 @@ import static java.lang.annotation.Eleme
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
+ * Verify that the annotated element has a number which is
+ * lower or equal than the given value or is {@code null}.
+ *
+ * Note that float and double are not portably supported due to
+ * possible rounding error problems.
+ *
+ * {@link DecimalMax} accepts a String whereas {@Max} accepts a long.
+ *
  * @version $Rev$ $Date$
  */
 @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Min.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Min.java?rev=1763119&r1=1763118&r2=1763119&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Min.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Min.java
Mon Oct  3 06:42:32 2016
@@ -30,6 +30,14 @@ import static java.lang.annotation.Eleme
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
+ * Verify that the annotated element has a number which is
+ * higher or equal than the given value or is {@code null}.
+ *
+ * Note that float and double are not portably supported due to
+ * possible rounding error problems.
+ *
+ * {@link DecimalMax} accepts a String whereas {@Max} accepts a long.
+ *
  * @version $Rev$ $Date$
  */
 @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Null.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Null.java?rev=1763119&r1=1763118&r2=1763119&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Null.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Null.java
Mon Oct  3 06:42:32 2016
@@ -31,6 +31,7 @@ import static java.lang.annotation.Reten
 
 /**
  * Constraint to verify that the validated field, parameter, etc is {@code null}.
+ *
  * @version $Rev$ $Date$
  */
 @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Past.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Past.java?rev=1763119&r1=1763118&r2=1763119&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Past.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Past.java
Mon Oct  3 06:42:32 2016
@@ -30,6 +30,11 @@ import static java.lang.annotation.Eleme
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
+ * Verify that the annotated value of the annotated element is in the past or {@code null}.
+ * Supported types are {@link java.util.Calendar} and {@link java.util.Date}
+ *
+ * Other types might be supported in a non-portable manner.
+ *
  * @version $Rev$ $Date$
  */
 @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Size.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Size.java?rev=1763119&r1=1763118&r2=1763119&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Size.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Size.java
Mon Oct  3 06:42:32 2016
@@ -30,6 +30,10 @@ import static java.lang.annotation.Eleme
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
+ * Verify that size of the annotated element is higher or equals the min value
+ * and lower or equals the max value or whether the annotated element is {@code null}.
+ * For Strings we will check the length, for Collections and arrays the size.
+ *
  * @version $Rev$ $Date$
  */
 @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })



Mime
View raw message