geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1762860 - in /geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation: ./ bootstrap/ constraints/ groups/
Date Fri, 30 Sep 2016 07:11:38 GMT
Author: struberg
Date: Fri Sep 30 07:11:37 2016
New Revision: 1762860

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

Modified:
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/Constraint.java
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/OverridesAttribute.java
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/Payload.java
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/bootstrap/ProviderSpecificBootstrap.java
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/NotNull.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/Pattern.java
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/groups/ConvertGroup.java
    geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/groups/Default.java

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/Constraint.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/Constraint.java?rev=1762860&r1=1762859&r2=1762860&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/Constraint.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/Constraint.java
Fri Sep 30 07:11:37 2016
@@ -24,12 +24,30 @@ import static java.lang.annotation.Eleme
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
+ * Meta annotation to declare a constraint annotation.
+ *
+ * Every custom constraint annotation meta-annotated with this very annotation must implement
the following fields:
+ * <ul>
+ *     <li>{@code String message()} - the message to be used if this constraint is
violated.</li>
+ *     <li>{@code Class<?>[] groups() default {};} - the validation group. See
{@link GroupSequence}.
+ *         If a constraint gets applied without any specific group then {@link javax.validation.groups.Default}
is assumed.
+ *     </li>
+ *     <li>{@code Class<? extends Payload>[] payload() default {};} - Custom
{@link Payload} for the contstraint.</li>
+ * </ul>
+ *
+ * @see javax.validation.constraints Built in Constraints
+ *
  * @version $Rev$ $Date$
  */
 @Documented
 @Target({ ANNOTATION_TYPE })
 @Retention(RUNTIME)
 public @interface Constraint {
-    public Class<? extends ConstraintValidator<?,?>>[] validatedBy();
+
+    /**
+     * @return the {@link ConstraintValidator} which gets used when this constraint is applied
+     *          to fields, methods (getters), types or parameter.
+     */
+    Class<? extends ConstraintValidator<?,?>>[] validatedBy();
 }
 

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/OverridesAttribute.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/OverridesAttribute.java?rev=1762860&r1=1762859&r2=1762860&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/OverridesAttribute.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/OverridesAttribute.java
Fri Sep 30 07:11:37 2016
@@ -39,7 +39,7 @@ public @interface OverridesAttribute {
     @Documented
     @Target({ METHOD })
     @Retention(RUNTIME)
-    public @interface List {
+    @interface List {
         OverridesAttribute[] value();
     }
 }

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/Payload.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/Payload.java?rev=1762860&r1=1762859&r2=1762860&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/Payload.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/Payload.java
Fri Sep 30 07:11:37 2016
@@ -18,6 +18,9 @@ package javax.validation;
 
 /**
  * Non-portable implementation specific way to provide metadata to constraints.
+ * This is just a marker interface to make it more typesafe.
+ *
+ * @see Constraint
  *
  * @version $Rev$ $Date$
  */

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/bootstrap/ProviderSpecificBootstrap.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/bootstrap/ProviderSpecificBootstrap.java?rev=1762860&r1=1762859&r2=1762860&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/bootstrap/ProviderSpecificBootstrap.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/bootstrap/ProviderSpecificBootstrap.java
Fri Sep 30 07:11:37 2016
@@ -21,8 +21,8 @@ import javax.validation.ValidationProvid
 
 public interface ProviderSpecificBootstrap<T extends Configuration<T>> {
 
-    public ProviderSpecificBootstrap<T> providerResolver(ValidationProviderResolver
resolver);
+    ProviderSpecificBootstrap<T> providerResolver(ValidationProviderResolver resolver);
 
-    public T configure();
+    T configure();
 }
 

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/NotNull.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/NotNull.java?rev=1762860&r1=1762859&r2=1762860&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/NotNull.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/NotNull.java
Fri Sep 30 07:11:37 2016
@@ -30,6 +30,8 @@ import static java.lang.annotation.Eleme
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
+ * Constraint to verify that the validated field, parameter, etc is not {@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/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=1762860&r1=1762859&r2=1762860&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
Fri Sep 30 07:11:37 2016
@@ -30,6 +30,7 @@ import static java.lang.annotation.Eleme
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
+ * 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/Pattern.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Pattern.java?rev=1762860&r1=1762859&r2=1762860&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Pattern.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/constraints/Pattern.java
Fri Sep 30 07:11:37 2016
@@ -30,6 +30,9 @@ import static java.lang.annotation.Eleme
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
+ * Constraint to verify that the validated field, parameter, etc matches the given regexp
pattern.
+ * The pattern format is as specified in {@link java.util.regex.Pattern}.
+ *
  * @version $Rev$ $Date$
  */
 @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@@ -48,7 +51,7 @@ public @interface Pattern {
 
     Class<? extends Payload>[] payload() default {};
 
-    public static enum Flag {
+    enum Flag {
 
         UNIX_LINES(java.util.regex.Pattern.UNIX_LINES),
 
@@ -66,7 +69,7 @@ public @interface Pattern {
 
         private final int value;
 
-        private Flag(int value) {
+        Flag(int value) {
             this.value = value;
         }
 

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/groups/ConvertGroup.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/groups/ConvertGroup.java?rev=1762860&r1=1762859&r2=1762860&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/groups/ConvertGroup.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/groups/ConvertGroup.java
Fri Sep 30 07:11:37 2016
@@ -38,7 +38,7 @@ public @interface ConvertGroup {
     @Target({ TYPE, METHOD, FIELD, CONSTRUCTOR, PARAMETER })
     @Retention(RUNTIME)
     @Documented
-    public @interface List {
+    @interface List {
         ConvertGroup[] value();
     }
 }

Modified: geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/groups/Default.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/groups/Default.java?rev=1762860&r1=1762859&r2=1762860&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/groups/Default.java
(original)
+++ geronimo/specs/trunk/geronimo-validation_1.1_spec/src/main/java/javax/validation/groups/Default.java
Fri Sep 30 07:11:37 2016
@@ -17,6 +17,8 @@
 package javax.validation.groups;
 
 /**
+ * The Validation group which is assumed if no other one is explicitly specified.
+ *
  * @version $Rev$ $Date$
  */
 public interface Default {



Mime
View raw message