Author: epbernard
Date: 2009-04-21 05:51:00 -0400 (Tue, 21 Apr 2009)
New Revision: 16368
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertFalse.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertTrue.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/DecimalMax.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/DecimalMin.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Digits.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Future.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Max.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Min.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/NotNull.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Null.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Past.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Pattern.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Size.java
Log:
BVAL-148 add @Constraint on built-in annotations
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertFalse.java
===================================================================
---
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertFalse.java 2009-04-20
22:26:31 UTC (rev 16367)
+++
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertFalse.java 2009-04-21
09:51:00 UTC (rev 16368)
@@ -24,6 +24,7 @@
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;
+import javax.validation.Constraint;
/**
* The annotated element must be false.
@@ -36,6 +37,7 @@
@Target({ METHOD, FIELD, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Documented
+@Constraint(validatedBy = {})
public @interface AssertFalse {
String message() default "{constraint.assertFalse}";
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertTrue.java
===================================================================
---
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertTrue.java 2009-04-20
22:26:31 UTC (rev 16367)
+++
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertTrue.java 2009-04-21
09:51:00 UTC (rev 16368)
@@ -24,6 +24,7 @@
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;
+import javax.validation.Constraint;
/**
* The annotated element must be true.
@@ -36,6 +37,7 @@
@Target({ METHOD, FIELD, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Documented
+@Constraint(validatedBy = {})
public @interface AssertTrue {
String message() default "{constraint.assertTrue}";
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/DecimalMax.java
===================================================================
---
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/DecimalMax.java 2009-04-20
22:26:31 UTC (rev 16367)
+++
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/DecimalMax.java 2009-04-21
09:51:00 UTC (rev 16368)
@@ -24,6 +24,7 @@
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;
+import javax.validation.Constraint;
/**
* The annotated element must be a number whose value must be lower or
@@ -47,6 +48,7 @@
@Target({ METHOD, FIELD, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Documented
+@Constraint(validatedBy = {})
public @interface DecimalMax {
String message() default "{constraint.decimalmax}";
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/DecimalMin.java
===================================================================
---
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/DecimalMin.java 2009-04-20
22:26:31 UTC (rev 16367)
+++
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/DecimalMin.java 2009-04-21
09:51:00 UTC (rev 16368)
@@ -24,6 +24,7 @@
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;
+import javax.validation.Constraint;
/**
* The annotated element must be a number whose value must be higher or
@@ -47,6 +48,7 @@
@Target({ METHOD, FIELD, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Documented
+@Constraint(validatedBy = {})
public @interface DecimalMin {
String message() default "{constraint.decimalmin}";
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Digits.java
===================================================================
---
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Digits.java 2009-04-20
22:26:31 UTC (rev 16367)
+++
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Digits.java 2009-04-21
09:51:00 UTC (rev 16368)
@@ -24,6 +24,7 @@
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;
+import javax.validation.Constraint;
/**
* The annotated element must be a number within accepted range
@@ -44,6 +45,7 @@
@Target({ METHOD, FIELD, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Documented
+@Constraint(validatedBy = {})
public @interface Digits {
String message() default "{constraint.digits}";
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Future.java
===================================================================
---
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Future.java 2009-04-20
22:26:31 UTC (rev 16367)
+++
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Future.java 2009-04-21
09:51:00 UTC (rev 16368)
@@ -24,6 +24,7 @@
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;
+import javax.validation.Constraint;
/**
* The annotated element must be a date in the future.
@@ -44,6 +45,7 @@
@Target({ METHOD, FIELD, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Documented
+@Constraint(validatedBy = {})
public @interface Future {
String message() default "{constraint.future}";
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Max.java
===================================================================
---
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Max.java 2009-04-20
22:26:31 UTC (rev 16367)
+++
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Max.java 2009-04-21
09:51:00 UTC (rev 16368)
@@ -24,6 +24,7 @@
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;
+import javax.validation.Constraint;
/**
* The annotated element must be a number whose value must be lower or
@@ -46,6 +47,7 @@
@Target({ METHOD, FIELD, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Documented
+@Constraint(validatedBy = {})
public @interface Max {
String message() default "{constraint.max}";
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Min.java
===================================================================
---
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Min.java 2009-04-20
22:26:31 UTC (rev 16367)
+++
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Min.java 2009-04-21
09:51:00 UTC (rev 16368)
@@ -24,6 +24,7 @@
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;
+import javax.validation.Constraint;
/**
* The annotated element must be a number whose value must be higher or
@@ -46,6 +47,7 @@
@Target({ METHOD, FIELD, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Documented
+@Constraint(validatedBy = {})
public @interface Min {
String message() default "{constraint.min}";
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/NotNull.java
===================================================================
---
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/NotNull.java 2009-04-20
22:26:31 UTC (rev 16367)
+++
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/NotNull.java 2009-04-21
09:51:00 UTC (rev 16368)
@@ -24,6 +24,7 @@
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;
+import javax.validation.Constraint;
/**
* The annotated element must not be <code>null</code>.
@@ -34,6 +35,7 @@
@Target({ METHOD, FIELD, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Documented
+@Constraint(validatedBy = {})
public @interface NotNull {
String message() default "{constraint.notNull}";
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Null.java
===================================================================
---
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Null.java 2009-04-20
22:26:31 UTC (rev 16367)
+++
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Null.java 2009-04-21
09:51:00 UTC (rev 16368)
@@ -24,6 +24,7 @@
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;
+import javax.validation.Constraint;
/**
* The annotated element must be null.
@@ -34,6 +35,7 @@
@Target({ METHOD, FIELD, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Documented
+@Constraint(validatedBy = {})
public @interface Null {
String message() default "{constraint.null}";
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Past.java
===================================================================
---
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Past.java 2009-04-20
22:26:31 UTC (rev 16367)
+++
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Past.java 2009-04-21
09:51:00 UTC (rev 16368)
@@ -24,6 +24,7 @@
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;
+import javax.validation.Constraint;
/**
* The annotated element must be a date in the past.
@@ -44,6 +45,7 @@
@Target({ METHOD, FIELD, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Documented
+@Constraint(validatedBy = {})
public @interface Past {
String message() default "{constraint.past}";
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Pattern.java
===================================================================
---
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Pattern.java 2009-04-20
22:26:31 UTC (rev 16367)
+++
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Pattern.java 2009-04-21
09:51:00 UTC (rev 16368)
@@ -7,6 +7,7 @@
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+import javax.validation.Constraint;
/**
* The annotated String must match the following regular expression.
@@ -20,6 +21,7 @@
@Target({ METHOD, FIELD, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Documented
+@Constraint(validatedBy = {})
public @interface Pattern {
/**
* regular expression to match
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Size.java
===================================================================
---
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Size.java 2009-04-20
22:26:31 UTC (rev 16367)
+++
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Size.java 2009-04-21
09:51:00 UTC (rev 16368)
@@ -24,6 +24,7 @@
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+import javax.validation.Constraint;
/**
* The annotated element size must be between the specified boundaries (included).
@@ -42,6 +43,7 @@
@Target({ METHOD, FIELD, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Documented
+@Constraint(validatedBy = {})
public @interface Size {
String message() default "{constraint.size}";
Class<?>[] groups() default {};