Skip to content
Browse files

HV-874 Supporting new Java 8 date/time types

  • Loading branch information...
1 parent baf8e2f commit e20c12aa0aba6e2bf21a2da7cefd74d06c2e2710 @khalidq khalidq committed with hferentschik May 26, 2014
Showing with 1,848 additions and 224 deletions.
  1. +1 −1 ...main/java/org/hibernate/validator/internal/constraintvalidators/{ → bv}/AssertFalseValidator.java
  2. +1 −1 .../main/java/org/hibernate/validator/internal/constraintvalidators/{ → bv}/AssertTrueValidator.java
  3. +1 −1 ...hibernate/validator/internal/constraintvalidators/{ → bv}/DecimalMaxValidatorForCharSequence.java
  4. +1 −1 ...a/org/hibernate/validator/internal/constraintvalidators/{ → bv}/DecimalMaxValidatorForNumber.java
  5. +1 −1 ...hibernate/validator/internal/constraintvalidators/{ → bv}/DecimalMinValidatorForCharSequence.java
  6. +1 −1 ...a/org/hibernate/validator/internal/constraintvalidators/{ → bv}/DecimalMinValidatorForNumber.java
  7. +1 −1 ...org/hibernate/validator/internal/constraintvalidators/{ → bv}/DigitsValidatorForCharSequence.java
  8. +1 −1 .../java/org/hibernate/validator/internal/constraintvalidators/{ → bv}/DigitsValidatorForNumber.java
  9. +1 −1 ...va/org/hibernate/validator/internal/constraintvalidators/{ → bv}/MaxValidatorForCharSequence.java
  10. +1 −1 ...ain/java/org/hibernate/validator/internal/constraintvalidators/{ → bv}/MaxValidatorForNumber.java
  11. +1 −1 ...va/org/hibernate/validator/internal/constraintvalidators/{ → bv}/MinValidatorForCharSequence.java
  12. +1 −1 ...ain/java/org/hibernate/validator/internal/constraintvalidators/{ → bv}/MinValidatorForNumber.java
  13. +1 −1 ...src/main/java/org/hibernate/validator/internal/constraintvalidators/{ → bv}/NotNullValidator.java
  14. +1 −1 ...ne/src/main/java/org/hibernate/validator/internal/constraintvalidators/{ → bv}/NullValidator.java
  15. +1 −1 ...src/main/java/org/hibernate/validator/internal/constraintvalidators/{ → bv}/PatternValidator.java
  16. +1 −1 .../hibernate/validator/internal/constraintvalidators/{ → bv/future}/FutureValidatorForCalendar.java
  17. +46 −0 ...ibernate/validator/internal/constraintvalidators/bv/future/FutureValidatorForChronoLocalDate.java
  18. +46 −0 ...nate/validator/internal/constraintvalidators/bv/future/FutureValidatorForChronoLocalDateTime.java
  19. +46 −0 ...nate/validator/internal/constraintvalidators/bv/future/FutureValidatorForChronoZonedDateTime.java
  20. +1 −1 .../org/hibernate/validator/internal/constraintvalidators/{ → bv/future}/FutureValidatorForDate.java
  21. +45 −0 ...va/org/hibernate/validator/internal/constraintvalidators/bv/future/FutureValidatorForInstant.java
  22. +45 −0 ...hibernate/validator/internal/constraintvalidators/bv/future/FutureValidatorForOffsetDateTime.java
  23. +1 −1 ...ate/validator/internal/constraintvalidators/{ → bv/future}/FutureValidatorForReadableInstant.java
  24. +1 −1 ...ate/validator/internal/constraintvalidators/{ → bv/future}/FutureValidatorForReadablePartial.java
  25. +45 −0 .../java/org/hibernate/validator/internal/constraintvalidators/bv/future/FutureValidatorForYear.java
  26. +45 −0 .../org/hibernate/validator/internal/constraintvalidators/bv/future/FutureValidatorForYearMonth.java
  27. +21 −0 ...e/src/main/java/org/hibernate/validator/internal/constraintvalidators/bv/future/package-info.java
  28. +21 −0 engine/src/main/java/org/hibernate/validator/internal/constraintvalidators/bv/package-info.java
  29. +1 −1 .../org/hibernate/validator/internal/constraintvalidators/{ → bv/past}/PastValidatorForCalendar.java
  30. +46 −0 ...rg/hibernate/validator/internal/constraintvalidators/bv/past/PastValidatorForChronoLocalDate.java
  31. +46 −0 ...ibernate/validator/internal/constraintvalidators/bv/past/PastValidatorForChronoLocalDateTime.java
  32. +46 −0 ...ibernate/validator/internal/constraintvalidators/bv/past/PastValidatorForChronoZonedDateTime.java
  33. +1 −1 ...java/org/hibernate/validator/internal/constraintvalidators/{ → bv/past}/PastValidatorForDate.java
  34. +45 −0 ...n/java/org/hibernate/validator/internal/constraintvalidators/bv/past/PastValidatorForInstant.java
  35. +45 −0 ...org/hibernate/validator/internal/constraintvalidators/bv/past/PastValidatorForOffsetDateTime.java
  36. +1 −1 ...bernate/validator/internal/constraintvalidators/{ → bv/past}/PastValidatorForReadableInstant.java
  37. +1 −1 ...bernate/validator/internal/constraintvalidators/{ → bv/past}/PastValidatorForReadablePartial.java
  38. +45 −0 ...main/java/org/hibernate/validator/internal/constraintvalidators/bv/past/PastValidatorForYear.java
  39. +45 −0 ...java/org/hibernate/validator/internal/constraintvalidators/bv/past/PastValidatorForYearMonth.java
  40. +21 −0 engine/src/main/java/org/hibernate/validator/internal/constraintvalidators/bv/past/package-info.java
  41. +1 −1 ...ava/org/hibernate/validator/internal/constraintvalidators/{ → bv/size}/SizeValidatorForArray.java
  42. +1 −1 ...bernate/validator/internal/constraintvalidators/{ → bv/size}/SizeValidatorForArraysOfBoolean.java
  43. +1 −1 .../hibernate/validator/internal/constraintvalidators/{ → bv/size}/SizeValidatorForArraysOfByte.java
  44. +1 −1 .../hibernate/validator/internal/constraintvalidators/{ → bv/size}/SizeValidatorForArraysOfChar.java
  45. +1 −1 ...ibernate/validator/internal/constraintvalidators/{ → bv/size}/SizeValidatorForArraysOfDouble.java
  46. +1 −1 ...hibernate/validator/internal/constraintvalidators/{ → bv/size}/SizeValidatorForArraysOfFloat.java
  47. +1 −1 ...g/hibernate/validator/internal/constraintvalidators/{ → bv/size}/SizeValidatorForArraysOfInt.java
  48. +1 −1 .../hibernate/validator/internal/constraintvalidators/{ → bv/size}/SizeValidatorForArraysOfLong.java
  49. +1 −1 ...nate/validator/internal/constraintvalidators/{ → bv/size}/SizeValidatorForArraysOfPrimitives.java
  50. +1 −1 ...hibernate/validator/internal/constraintvalidators/{ → bv/size}/SizeValidatorForArraysOfShort.java
  51. +1 −1 .../hibernate/validator/internal/constraintvalidators/{ → bv/size}/SizeValidatorForCharSequence.java
  52. +1 −1 ...rg/hibernate/validator/internal/constraintvalidators/{ → bv/size}/SizeValidatorForCollection.java
  53. +1 −1 .../java/org/hibernate/validator/internal/constraintvalidators/{ → bv/size}/SizeValidatorForMap.java
  54. +21 −0 engine/src/main/java/org/hibernate/validator/internal/constraintvalidators/bv/size/package-info.java
  55. +1 −1 engine/src/main/java/org/hibernate/validator/internal/constraintvalidators/{ → hv}/EANValidator.java
  56. +1 −1 ...e/src/main/java/org/hibernate/validator/internal/constraintvalidators/{ → hv}/EmailValidator.java
  57. +1 −1 .../src/main/java/org/hibernate/validator/internal/constraintvalidators/{ → hv}/LengthValidator.java
  58. +1 −1 ...c/main/java/org/hibernate/validator/internal/constraintvalidators/{ → hv}/LuhnCheckValidator.java
  59. +1 −1 .../main/java/org/hibernate/validator/internal/constraintvalidators/{ → hv}/Mod10CheckValidator.java
  60. +1 −1 .../main/java/org/hibernate/validator/internal/constraintvalidators/{ → hv}/Mod11CheckValidator.java
  61. +1 −1 engine/src/main/java/org/hibernate/validator/internal/constraintvalidators/{ → hv}/ModCheckBase.java
  62. +1 −1 ...rc/main/java/org/hibernate/validator/internal/constraintvalidators/{ → hv}/ModCheckValidator.java
  63. +1 −1 ...rc/main/java/org/hibernate/validator/internal/constraintvalidators/{ → hv}/NotBlankValidator.java
  64. +1 −1 ...org/hibernate/validator/internal/constraintvalidators/{ → hv}/ParameterScriptAssertValidator.java
  65. +1 −1 ...rc/main/java/org/hibernate/validator/internal/constraintvalidators/{ → hv}/SafeHtmlValidator.java
  66. +1 −1 .../main/java/org/hibernate/validator/internal/constraintvalidators/{ → hv}/ScriptAssertContext.java
  67. +1 −1 ...ain/java/org/hibernate/validator/internal/constraintvalidators/{ → hv}/ScriptAssertValidator.java
  68. +1 −1 engine/src/main/java/org/hibernate/validator/internal/constraintvalidators/{ → hv}/URLValidator.java
  69. +21 −0 engine/src/main/java/org/hibernate/validator/internal/constraintvalidators/hv/package-info.java
  70. +0 −26 engine/src/main/java/org/hibernate/validator/internal/constraintvalidators/package.html
  71. +81 −46 engine/src/main/java/org/hibernate/validator/internal/metadata/core/ConstraintHelper.java
  72. +1 −1 ...e/src/main/java/org/hibernate/validator/internal/metadata/descriptor/ParameterDescriptorImpl.java
  73. +1 −1 ...ain/java/org/hibernate/validator/internal/metadata/provider/MetaDataProviderKeyedByClassName.java
  74. +12 −0 engine/src/main/java/org/hibernate/validator/internal/util/Version.java
  75. +1 −1 engine/src/test/java/org/hibernate/validator/test/internal/bootstrap/BootstrappingTest.java
  76. +2 −2 .../org/hibernate/validator/test/internal/constraintvalidators/{ → bv}/AssertFalseValidatorTest.java
  77. +2 −2 ...a/org/hibernate/validator/test/internal/constraintvalidators/{ → bv}/AssertTrueValidatorTest.java
  78. +1 −1 ...nate/validator/test/internal/constraintvalidators/{ → bv}/DecimalMinMaxValidatorBoundaryTest.java
  79. +3 −2 ...nate/validator/test/internal/constraintvalidators/{ → bv}/DigitsValidatorForCharSequenceTest.java
  80. +2 −2 .../hibernate/validator/test/internal/constraintvalidators/{ → bv}/DigitsValidatorForNumberTest.java
  81. +3 −3 ...org/hibernate/validator/test/internal/constraintvalidators/{ → bv}/MaxValidatorForNumberTest.java
  82. +5 −4 ...org/hibernate/validator/test/internal/constraintvalidators/{ → bv}/MaxValidatorForStringTest.java
  83. +3 −3 ...g/hibernate/validator/test/internal/constraintvalidators/{ → bv}/MinMaxValidatorBoundaryTest.java
  84. +3 −3 ...org/hibernate/validator/test/internal/constraintvalidators/{ → bv}/MinValidatorForNumberTest.java
  85. +5 −4 ...org/hibernate/validator/test/internal/constraintvalidators/{ → bv}/MinValidatorForStringTest.java
  86. +2 −2 ...java/org/hibernate/validator/test/internal/constraintvalidators/{ → bv}/NotNullValidatorTest.java
  87. +2 −2 ...st/java/org/hibernate/validator/test/internal/constraintvalidators/{ → bv}/NullValidatorTest.java
  88. +3 −2 ...java/org/hibernate/validator/test/internal/constraintvalidators/{ → bv}/PatternValidatorTest.java
  89. +1 −1 ...st/java/org/hibernate/validator/test/internal/constraintvalidators/{ → bv/future}/DateHolder.java
  90. +2 −2 ...e/validator/test/internal/constraintvalidators/{ → bv/future}/FutureValidatorForCalendarTest.java
  91. +98 −0 ...validator/test/internal/constraintvalidators/bv/future/FutureValidatorForChronoLocalDateTest.java
  92. +53 −0 ...dator/test/internal/constraintvalidators/bv/future/FutureValidatorForChronoLocalDateTimeTest.java
  93. +59 −0 ...dator/test/internal/constraintvalidators/bv/future/FutureValidatorForChronoZonedDateTimeTest.java
  94. +2 −2 ...rnate/validator/test/internal/constraintvalidators/{ → bv/future}/FutureValidatorForDateTest.java
  95. +52 −0 ...bernate/validator/test/internal/constraintvalidators/bv/future/FutureValidatorForInstantTest.java
  96. +57 −0 .../validator/test/internal/constraintvalidators/bv/future/FutureValidatorForOffsetDateTimeTest.java
  97. +2 −2 ...ator/test/internal/constraintvalidators/{ → bv/future}/FutureValidatorForReadableInstantTest.java
  98. +2 −2 ...ator/test/internal/constraintvalidators/{ → bv/future}/FutureValidatorForReadablePartialTest.java
  99. +52 −0 ...rnate/validator/test/internal/constraintvalidators/bv/future/FutureValidatorForYearMonthTest.java
  100. +52 −0 .../hibernate/validator/test/internal/constraintvalidators/bv/future/FutureValidatorForYearTest.java
  101. +1 −1 ...rg/hibernate/validator/test/internal/constraintvalidators/{ → bv/future}/FutureValidatorTest.java
  102. +2 −2 ...rnate/validator/test/internal/constraintvalidators/{ → bv/past}/PastValidatorForCalendarTest.java
  103. +98 −0 ...ate/validator/test/internal/constraintvalidators/bv/past/PastValidatorForChronoLocalDateTest.java
  104. +53 −0 ...validator/test/internal/constraintvalidators/bv/past/PastValidatorForChronoLocalDateTimeTest.java
  105. +59 −0 ...validator/test/internal/constraintvalidators/bv/past/PastValidatorForChronoZonedDateTimeTest.java
  106. +2 −2 ...hibernate/validator/test/internal/constraintvalidators/{ → bv/past}/PastValidatorForDateTest.java
  107. +52 −0 ...g/hibernate/validator/test/internal/constraintvalidators/bv/past/PastValidatorForInstantTest.java
  108. +57 −0 ...nate/validator/test/internal/constraintvalidators/bv/past/PastValidatorForOffsetDateTimeTest.java
  109. +2 −2 ...alidator/test/internal/constraintvalidators/{ → bv/past}/PastValidatorForReadableInstantTest.java
  110. +2 −2 ...alidator/test/internal/constraintvalidators/{ → bv/past}/PastValidatorForReadablePartialTest.java
  111. +52 −0 ...hibernate/validator/test/internal/constraintvalidators/bv/past/PastValidatorForYearMonthTest.java
  112. +52 −0 .../org/hibernate/validator/test/internal/constraintvalidators/bv/past/PastValidatorForYearTest.java
  113. +14 −13 ...va/org/hibernate/validator/test/internal/constraintvalidators/{ → bv/size}/SizeValidatorTest.java
  114. +2 −2 ...t/java/org/hibernate/validator/test/internal/constraintvalidators/{ → hv}/BlankValidatorTest.java
  115. +2 −1 ...hibernate/validator/test/internal/constraintvalidators/{ → hv}/CreditCardNumberValidatorTest.java
  116. +1 −1 ...e/src/test/java/org/hibernate/validator/test/internal/constraintvalidators/{ → hv}/EAN13Test.java
  117. +1 −1 ...ne/src/test/java/org/hibernate/validator/test/internal/constraintvalidators/{ → hv}/EAN8Test.java
  118. +3 −2 ...t/java/org/hibernate/validator/test/internal/constraintvalidators/{ → hv}/EmailValidatorTest.java
  119. +3 −2 .../java/org/hibernate/validator/test/internal/constraintvalidators/{ → hv}/LengthValidatorTest.java
  120. +3 −2 ...va/org/hibernate/validator/test/internal/constraintvalidators/{ → hv}/LuhnCheckValidatorTest.java
  121. +3 −2 ...a/org/hibernate/validator/test/internal/constraintvalidators/{ → hv}/Mod10CheckValidatorTest.java
  122. +3 −2 ...a/org/hibernate/validator/test/internal/constraintvalidators/{ → hv}/Mod11CheckValidatorTest.java
  123. +3 −2 ...ava/org/hibernate/validator/test/internal/constraintvalidators/{ → hv}/ModCheckValidatorTest.java
  124. +2 −2 ...nate/validator/test/internal/constraintvalidators/{ → hv}/ParameterScriptAssertValidatorTest.java
  125. +2 −2 ...ava/org/hibernate/validator/test/internal/constraintvalidators/{ → hv}/SafeHtmlValidatorTest.java
  126. +4 −4 ...org/hibernate/validator/test/internal/constraintvalidators/{ → hv}/ScriptAssertValidatorTest.java
  127. +3 −2 ...est/java/org/hibernate/validator/test/internal/constraintvalidators/{ → hv}/URLValidatorTest.java
  128. +3 −3 ...ne/src/test/java/org/hibernate/validator/test/internal/engine/ConstraintValidatorCachingTest.java
  129. +1 −1 ...hibernate/validator/test/internal/engine/constraintvalidation/ConstraintValidatorManagerTest.java
  130. +1 −1 ...java/org/hibernate/validator/test/internal/engine/groups/validationorder/ValidationOrderTest.java
  131. +2 −2 engine/src/test/java/org/hibernate/validator/test/internal/xml/XmlMappingParserTest.java
  132. +2 −2 ...a/org/hibernate/validator/{test/internal/constraintvalidators → testutil}/MyCustomStringImpl.java
  133. +3 −0 src/main/build-config/checkstyle.xml
View
2 ...raintvalidators/AssertFalseValidator.java → ...ntvalidators/bv/AssertFalseValidator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
View
2 ...traintvalidators/AssertTrueValidator.java → ...intvalidators/bv/AssertTrueValidator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
View
2 ...s/DecimalMaxValidatorForCharSequence.java → ...v/DecimalMaxValidatorForCharSequence.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv;
import java.math.BigDecimal;
import javax.validation.ConstraintValidator;
View
2 ...idators/DecimalMaxValidatorForNumber.java → ...tors/bv/DecimalMaxValidatorForNumber.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv;
import java.math.BigDecimal;
import java.math.BigInteger;
View
2 ...s/DecimalMinValidatorForCharSequence.java → ...v/DecimalMinValidatorForCharSequence.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv;
import java.math.BigDecimal;
import javax.validation.ConstraintValidator;
View
2 ...idators/DecimalMinValidatorForNumber.java → ...tors/bv/DecimalMinValidatorForNumber.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv;
import java.math.BigDecimal;
import java.math.BigInteger;
View
2 ...ators/DigitsValidatorForCharSequence.java → ...rs/bv/DigitsValidatorForCharSequence.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv;
import java.math.BigDecimal;
import javax.validation.ConstraintValidator;
View
2 ...tvalidators/DigitsValidatorForNumber.java → ...lidators/bv/DigitsValidatorForNumber.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv;
import java.math.BigDecimal;
import javax.validation.ConstraintValidator;
View
2 ...lidators/MaxValidatorForCharSequence.java → ...ators/bv/MaxValidatorForCharSequence.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv;
import java.math.BigDecimal;
import javax.validation.ConstraintValidator;
View
2 ...aintvalidators/MaxValidatorForNumber.java → ...tvalidators/bv/MaxValidatorForNumber.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv;
import java.math.BigDecimal;
import java.math.BigInteger;
View
2 ...lidators/MinValidatorForCharSequence.java → ...ators/bv/MinValidatorForCharSequence.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv;
import java.math.BigDecimal;
import javax.validation.ConstraintValidator;
View
2 ...aintvalidators/MinValidatorForNumber.java → ...tvalidators/bv/MinValidatorForNumber.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv;
import java.math.BigDecimal;
import java.math.BigInteger;
View
2 ...onstraintvalidators/NotNullValidator.java → ...traintvalidators/bv/NotNullValidator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
View
2 ...l/constraintvalidators/NullValidator.java → ...onstraintvalidators/bv/NullValidator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
View
2 ...onstraintvalidators/PatternValidator.java → ...traintvalidators/bv/PatternValidator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv;
import java.util.regex.Matcher;
import java.util.regex.PatternSyntaxException;
View
2 ...alidators/FutureValidatorForCalendar.java → ...bv/future/FutureValidatorForCalendar.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.future;
import java.util.Calendar;
import javax.validation.ConstraintValidator;
View
46 .../validator/internal/constraintvalidators/bv/future/FutureValidatorForChronoLocalDate.java
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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 org.hibernate.validator.internal.constraintvalidators.bv.future;
+
+import java.time.LocalDate;
+import java.time.chrono.ChronoLocalDate;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Future;
+
+/**
+ * Check that the {@code java.time.chrono.ChronoLocalDate} passed is in the future.
+ *
+ * @author Khalid Alqinyah
+ */
+public class FutureValidatorForChronoLocalDate implements ConstraintValidator<Future, ChronoLocalDate> {
+
+ @Override
+ public void initialize(Future constraintAnnotation) {
+
+ }
+
+ @Override
+ public boolean isValid(ChronoLocalDate value, ConstraintValidatorContext context) {
+ // null values are valid
+ if ( value == null ) {
+ return true;
+ }
+
+ return value.isAfter( LocalDate.now() );
+ }
+}
View
46 ...idator/internal/constraintvalidators/bv/future/FutureValidatorForChronoLocalDateTime.java
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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 org.hibernate.validator.internal.constraintvalidators.bv.future;
+
+import java.time.LocalDateTime;
+import java.time.chrono.ChronoLocalDateTime;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Future;
+
+/**
+ * Check that the {@code java.time.chrono.ChronoLocalDateTime} passed is in the future.
+ *
+ * @author Khalid Alqinyah
+ */
+public class FutureValidatorForChronoLocalDateTime implements ConstraintValidator<Future, ChronoLocalDateTime<?>> {
+
+ @Override
+ public void initialize(Future constraintAnnotation) {
+
+ }
+
+ @Override
+ public boolean isValid(ChronoLocalDateTime value, ConstraintValidatorContext context) {
+ // null values are valid
+ if ( value == null ) {
+ return true;
+ }
+
+ return value.isAfter( LocalDateTime.now() );
+ }
+}
View
46 ...idator/internal/constraintvalidators/bv/future/FutureValidatorForChronoZonedDateTime.java
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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 org.hibernate.validator.internal.constraintvalidators.bv.future;
+
+import java.time.ZonedDateTime;
+import java.time.chrono.ChronoZonedDateTime;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Future;
+
+/**
+ * Check that the {@code java.time.chrono.ChronoZonedDateTime} passed is in the future.
+ *
+ * @author Khalid Alqinyah
+ */
+public class FutureValidatorForChronoZonedDateTime implements ConstraintValidator<Future, ChronoZonedDateTime<?>> {
+
+ @Override
+ public void initialize(Future constraintAnnotation) {
+
+ }
+
+ @Override
+ public boolean isValid(ChronoZonedDateTime value, ConstraintValidatorContext context) {
+ // null values are valid
+ if ( value == null ) {
+ return true;
+ }
+
+ return value.isAfter( ZonedDateTime.now() );
+ }
+}
View
2 ...intvalidators/FutureValidatorForDate.java → ...ors/bv/future/FutureValidatorForDate.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.future;
import java.util.Date;
import javax.validation.ConstraintValidator;
View
45 ...ibernate/validator/internal/constraintvalidators/bv/future/FutureValidatorForInstant.java
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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 org.hibernate.validator.internal.constraintvalidators.bv.future;
+
+import java.time.Instant;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Future;
+
+/**
+ * Check that the {@code java.time.Instant} passed is in the future.
+ *
+ * @author Khalid Alqinyah
+ */
+public class FutureValidatorForInstant implements ConstraintValidator<Future, Instant> {
+
+ @Override
+ public void initialize(Future constraintAnnotation) {
+
+ }
+
+ @Override
+ public boolean isValid(Instant value, ConstraintValidatorContext context) {
+ // null values are valid
+ if ( value == null ) {
+ return true;
+ }
+
+ return value.isAfter( Instant.now() );
+ }
+}
View
45 ...e/validator/internal/constraintvalidators/bv/future/FutureValidatorForOffsetDateTime.java
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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 org.hibernate.validator.internal.constraintvalidators.bv.future;
+
+import java.time.OffsetDateTime;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Future;
+
+/**
+ * Check that the {@code java.time.OffsetDateTime} passed is in the future.
+ *
+ * @author Khalid Alqinyah
+ */
+public class FutureValidatorForOffsetDateTime implements ConstraintValidator<Future, OffsetDateTime> {
+
+ @Override
+ public void initialize(Future constraintAnnotation) {
+
+ }
+
+ @Override
+ public boolean isValid(OffsetDateTime value, ConstraintValidatorContext context) {
+ // null values are valid
+ if ( value == null ) {
+ return true;
+ }
+
+ return value.isAfter( OffsetDateTime.now() );
+ }
+}
View
2 ...rs/FutureValidatorForReadableInstant.java → ...re/FutureValidatorForReadableInstant.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.future;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
View
2 ...rs/FutureValidatorForReadablePartial.java → ...re/FutureValidatorForReadablePartial.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.future;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
View
45 ...g/hibernate/validator/internal/constraintvalidators/bv/future/FutureValidatorForYear.java
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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 org.hibernate.validator.internal.constraintvalidators.bv.future;
+
+import java.time.Year;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Future;
+
+/**
+ * Check that the {@code java.time.Year} passed is in the future.
+ *
+ * @author Khalid Alqinyah
+ */
+public class FutureValidatorForYear implements ConstraintValidator<Future, Year> {
+
+ @Override
+ public void initialize(Future constraintAnnotation) {
+
+ }
+
+ @Override
+ public boolean isValid(Year value, ConstraintValidatorContext context) {
+ // null values are valid
+ if ( value == null ) {
+ return true;
+ }
+
+ return value.isAfter( Year.now() );
+ }
+}
View
45 ...ernate/validator/internal/constraintvalidators/bv/future/FutureValidatorForYearMonth.java
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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 org.hibernate.validator.internal.constraintvalidators.bv.future;
+
+import java.time.YearMonth;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Future;
+
+/**
+ * Check that the {@code java.time.YearMonth} passed is in the future.
+ *
+ * @author Khalid Alqinyah
+ */
+public class FutureValidatorForYearMonth implements ConstraintValidator<Future, YearMonth> {
+
+ @Override
+ public void initialize(Future constraintAnnotation) {
+
+ }
+
+ @Override
+ public boolean isValid(YearMonth value, ConstraintValidatorContext context) {
+ // null values are valid
+ if ( value == null ) {
+ return true;
+ }
+
+ return value.isAfter( YearMonth.now() );
+ }
+}
View
21 ...in/java/org/hibernate/validator/internal/constraintvalidators/bv/future/package-info.java
@@ -0,0 +1,21 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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.
+*/
+
+/**
+ * Constraint validator implementations of the Bean Validation {@code Future} constraint.
+ */
+package org.hibernate.validator.internal.constraintvalidators.bv.future;
View
21 .../src/main/java/org/hibernate/validator/internal/constraintvalidators/bv/package-info.java
@@ -0,0 +1,21 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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.
+*/
+
+/**
+ * Implementations of the Bean Validation built-in constraints.
+ */
+package org.hibernate.validator.internal.constraintvalidators.bv;
View
2 ...tvalidators/PastValidatorForCalendar.java → ...ors/bv/past/PastValidatorForCalendar.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.past;
import java.util.Calendar;
import javax.validation.ConstraintValidator;
View
46 ...nate/validator/internal/constraintvalidators/bv/past/PastValidatorForChronoLocalDate.java
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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 org.hibernate.validator.internal.constraintvalidators.bv.past;
+
+import java.time.LocalDate;
+import java.time.chrono.ChronoLocalDate;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Past;
+
+/**
+ * Check that the {@code java.time.chrono.ChronoLocalDate} passed is in the past.
+ *
+ * @author Khalid Alqinyah
+ */
+public class PastValidatorForChronoLocalDate implements ConstraintValidator<Past, ChronoLocalDate> {
+
+ @Override
+ public void initialize(Past constraintAnnotation) {
+
+ }
+
+ @Override
+ public boolean isValid(ChronoLocalDate value, ConstraintValidatorContext context) {
+ // null values are valid
+ if ( value == null ) {
+ return true;
+ }
+
+ return value.isBefore( LocalDate.now() );
+ }
+}
View
46 .../validator/internal/constraintvalidators/bv/past/PastValidatorForChronoLocalDateTime.java
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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 org.hibernate.validator.internal.constraintvalidators.bv.past;
+
+import java.time.LocalDateTime;
+import java.time.chrono.ChronoLocalDateTime;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Past;
+
+/**
+ * Check that the {@code java.time.chrono.ChronoLocalDateTime} passed is in the past.
+ *
+ * @author Khalid Alqinyah
+ */
+public class PastValidatorForChronoLocalDateTime implements ConstraintValidator<Past, ChronoLocalDateTime<?>> {
+
+ @Override
+ public void initialize(Past constraintAnnotation) {
+
+ }
+
+ @Override
+ public boolean isValid(ChronoLocalDateTime value, ConstraintValidatorContext context) {
+ // null values are valid
+ if ( value == null ) {
+ return true;
+ }
+
+ return value.isBefore( LocalDateTime.now() );
+ }
+}
View
46 .../validator/internal/constraintvalidators/bv/past/PastValidatorForChronoZonedDateTime.java
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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 org.hibernate.validator.internal.constraintvalidators.bv.past;
+
+import java.time.ZonedDateTime;
+import java.time.chrono.ChronoZonedDateTime;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Past;
+
+/**
+ * Check that the {@code java.time.chrono.ChronoZonedDateTime} passed is in the past.
+ *
+ * @author Khalid Alqinyah
+ */
+public class PastValidatorForChronoZonedDateTime implements ConstraintValidator<Past, ChronoZonedDateTime<?>> {
+
+ @Override
+ public void initialize(Past constraintAnnotation) {
+
+ }
+
+ @Override
+ public boolean isValid(ChronoZonedDateTime value, ConstraintValidatorContext context) {
+ // null values are valid
+ if ( value == null ) {
+ return true;
+ }
+
+ return value.isBefore( ZonedDateTime.now() );
+ }
+}
View
2 ...raintvalidators/PastValidatorForDate.java → ...idators/bv/past/PastValidatorForDate.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.past;
import java.util.Date;
import javax.validation.ConstraintValidator;
View
45 ...rg/hibernate/validator/internal/constraintvalidators/bv/past/PastValidatorForInstant.java
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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 org.hibernate.validator.internal.constraintvalidators.bv.past;
+
+import java.time.Instant;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Past;
+
+/**
+ * Check that the {@code java.time.Instant} passed is in the past.
+ *
+ * @author Khalid Alqinyah
+ */
+public class PastValidatorForInstant implements ConstraintValidator<Past, Instant> {
+
+ @Override
+ public void initialize(Past constraintAnnotation) {
+
+ }
+
+ @Override
+ public boolean isValid(Instant value, ConstraintValidatorContext context) {
+ // null values are valid
+ if ( value == null ) {
+ return true;
+ }
+
+ return value.isBefore( Instant.now() );
+ }
+}
View
45 ...rnate/validator/internal/constraintvalidators/bv/past/PastValidatorForOffsetDateTime.java
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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 org.hibernate.validator.internal.constraintvalidators.bv.past;
+
+import java.time.OffsetDateTime;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Past;
+
+/**
+ * Check that the {@code java.time.OffsetDateTime} passed is in the past.
+ *
+ * @author Khalid Alqinyah
+ */
+public class PastValidatorForOffsetDateTime implements ConstraintValidator<Past, OffsetDateTime> {
+
+ @Override
+ public void initialize(Past constraintAnnotation) {
+
+ }
+
+ @Override
+ public boolean isValid(OffsetDateTime value, ConstraintValidatorContext context) {
+ // null values are valid
+ if ( value == null ) {
+ return true;
+ }
+
+ return value.isBefore( OffsetDateTime.now() );
+ }
+}
View
2 ...tors/PastValidatorForReadableInstant.java → ...past/PastValidatorForReadableInstant.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.past;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
View
2 ...tors/PastValidatorForReadablePartial.java → ...past/PastValidatorForReadablePartial.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.past;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
View
45 ...a/org/hibernate/validator/internal/constraintvalidators/bv/past/PastValidatorForYear.java
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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 org.hibernate.validator.internal.constraintvalidators.bv.past;
+
+import java.time.Year;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Past;
+
+/**
+ * Check that the {@code java.time.Year} passed is in the past.
+ *
+ * @author Khalid Alqinyah
+ */
+public class PastValidatorForYear implements ConstraintValidator<Past, Year> {
+
+ @Override
+ public void initialize(Past constraintAnnotation) {
+
+ }
+
+ @Override
+ public boolean isValid(Year value, ConstraintValidatorContext context) {
+ // null values are valid
+ if ( value == null ) {
+ return true;
+ }
+
+ return value.isBefore( Year.now() );
+ }
+}
View
45 .../hibernate/validator/internal/constraintvalidators/bv/past/PastValidatorForYearMonth.java
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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 org.hibernate.validator.internal.constraintvalidators.bv.past;
+
+import java.time.YearMonth;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Past;
+
+/**
+ * Check that the {@code java.time.YearMonth} passed is in the past.
+ *
+ * @author Khalid Alqinyah
+ */
+public class PastValidatorForYearMonth implements ConstraintValidator<Past, YearMonth> {
+
+ @Override
+ public void initialize(Past constraintAnnotation) {
+
+ }
+
+ @Override
+ public boolean isValid(YearMonth value, ConstraintValidatorContext context) {
+ // null values are valid
+ if ( value == null ) {
+ return true;
+ }
+
+ return value.isBefore( YearMonth.now() );
+ }
+}
View
21 ...main/java/org/hibernate/validator/internal/constraintvalidators/bv/past/package-info.java
@@ -0,0 +1,21 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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.
+*/
+
+/**
+ * Constraint validator implementations of the Bean Validation {@code Past} constraint.
+ */
+package org.hibernate.validator.internal.constraintvalidators.bv.past;
View
2 ...aintvalidators/SizeValidatorForArray.java → ...dators/bv/size/SizeValidatorForArray.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.size;
import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
View
2 ...tors/SizeValidatorForArraysOfBoolean.java → ...size/SizeValidatorForArraysOfBoolean.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.size;
import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
View
2 ...idators/SizeValidatorForArraysOfByte.java → ...bv/size/SizeValidatorForArraysOfByte.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.size;
import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
View
2 ...idators/SizeValidatorForArraysOfChar.java → ...bv/size/SizeValidatorForArraysOfChar.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.size;
import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
View
2 ...ators/SizeValidatorForArraysOfDouble.java → .../size/SizeValidatorForArraysOfDouble.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.size;
import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
View
2 ...dators/SizeValidatorForArraysOfFloat.java → ...v/size/SizeValidatorForArraysOfFloat.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.size;
import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
View
2 ...lidators/SizeValidatorForArraysOfInt.java → .../bv/size/SizeValidatorForArraysOfInt.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.size;
import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
View
2 ...idators/SizeValidatorForArraysOfLong.java → ...bv/size/SizeValidatorForArraysOfLong.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.size;
import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
View
2 ...s/SizeValidatorForArraysOfPrimitives.java → ...e/SizeValidatorForArraysOfPrimitives.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.size;
import javax.validation.constraints.Size;
View
2 ...dators/SizeValidatorForArraysOfShort.java → ...v/size/SizeValidatorForArraysOfShort.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.size;
import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
View
2 ...idators/SizeValidatorForCharSequence.java → ...bv/size/SizeValidatorForCharSequence.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.size;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
View
2 ...alidators/SizeValidatorForCollection.java → ...s/bv/size/SizeValidatorForCollection.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.size;
import java.util.Collection;
import javax.validation.ConstraintValidator;
View
2 ...traintvalidators/SizeValidatorForMap.java → ...lidators/bv/size/SizeValidatorForMap.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.bv.size;
import java.util.Map;
import javax.validation.ConstraintValidator;
View
21 ...main/java/org/hibernate/validator/internal/constraintvalidators/bv/size/package-info.java
@@ -0,0 +1,21 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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.
+*/
+
+/**
+ * Implementations of the Bean Validation {@code Size} constraint.
+ */
+package org.hibernate.validator.internal.constraintvalidators.bv.size;
View
2 ...al/constraintvalidators/EANValidator.java → ...constraintvalidators/hv/EANValidator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.hv;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
View
2 .../constraintvalidators/EmailValidator.java → ...nstraintvalidators/hv/EmailValidator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.hv;
import java.net.IDN;
import java.util.regex.Matcher;
View
2 ...constraintvalidators/LengthValidator.java → ...straintvalidators/hv/LengthValidator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.hv;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
View
2 ...straintvalidators/LuhnCheckValidator.java → ...aintvalidators/hv/LuhnCheckValidator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.hv;
import java.util.List;
import javax.validation.ConstraintValidator;
View
2 ...traintvalidators/Mod10CheckValidator.java → ...intvalidators/hv/Mod10CheckValidator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.hv;
import java.util.List;
import javax.validation.ConstraintValidator;
View
2 ...traintvalidators/Mod11CheckValidator.java → ...intvalidators/hv/Mod11CheckValidator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.hv;
import java.util.Collections;
import java.util.List;
View
2 ...al/constraintvalidators/ModCheckBase.java → ...constraintvalidators/hv/ModCheckBase.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.hv;
import java.util.ArrayList;
import java.util.List;
View
2 ...nstraintvalidators/ModCheckValidator.java → ...raintvalidators/hv/ModCheckValidator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.hv;
import java.util.List;
import javax.validation.ConstraintValidator;
View
2 ...nstraintvalidators/NotBlankValidator.java → ...raintvalidators/hv/NotBlankValidator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.hv;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
View
2 ...ators/ParameterScriptAssertValidator.java → ...rs/hv/ParameterScriptAssertValidator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.hv;
import java.util.List;
import java.util.Map;
View
2 ...nstraintvalidators/SafeHtmlValidator.java → ...raintvalidators/hv/SafeHtmlValidator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.hv;
import java.util.Iterator;
import javax.validation.ConstraintValidator;
View
2 ...traintvalidators/ScriptAssertContext.java → ...intvalidators/hv/ScriptAssertContext.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.hv;
import java.util.Map;
import javax.script.ScriptException;
View
2 ...aintvalidators/ScriptAssertValidator.java → ...tvalidators/hv/ScriptAssertValidator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.hv;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
View
2 ...al/constraintvalidators/URLValidator.java → ...constraintvalidators/hv/URLValidator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.internal.constraintvalidators;
+package org.hibernate.validator.internal.constraintvalidators.hv;
import java.net.MalformedURLException;
import javax.validation.ConstraintValidator;
View
21 .../src/main/java/org/hibernate/validator/internal/constraintvalidators/hv/package-info.java
@@ -0,0 +1,21 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2014, Red Hat, Inc. and/or its affiliates, 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.
+*/
+
+/**
+ * Implementations of Hibernate Validator specific constraints.
+ */
+package org.hibernate.validator.internal.constraintvalidators.hv;
View
26 engine/src/main/java/org/hibernate/validator/internal/constraintvalidators/package.html
@@ -1,26 +0,0 @@
-<!--
- ~
- ~ JBoss, Home of Professional Open Source
- ~ Copyright 2010, Red Hat, Inc. and/or its affiliates, 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.
--->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
-<head>
-</head>
-<body>
-<p>Implementations of the Bean Validation built-in as well as
-Hibernate Validator specific constraints.</p>
-</body>
-</html>
View
127 engine/src/main/java/org/hibernate/validator/internal/metadata/core/ConstraintHelper.java
@@ -55,54 +55,69 @@
import org.hibernate.validator.constraints.SafeHtml;
import org.hibernate.validator.constraints.ScriptAssert;
import org.hibernate.validator.constraints.URL;
-import org.hibernate.validator.internal.constraintvalidators.AssertFalseValidator;
-import org.hibernate.validator.internal.constraintvalidators.AssertTrueValidator;
-import org.hibernate.validator.internal.constraintvalidators.DecimalMaxValidatorForCharSequence;
-import org.hibernate.validator.internal.constraintvalidators.DecimalMaxValidatorForNumber;
-import org.hibernate.validator.internal.constraintvalidators.DecimalMinValidatorForCharSequence;
-import org.hibernate.validator.internal.constraintvalidators.DecimalMinValidatorForNumber;
-import org.hibernate.validator.internal.constraintvalidators.DigitsValidatorForCharSequence;
-import org.hibernate.validator.internal.constraintvalidators.DigitsValidatorForNumber;
-import org.hibernate.validator.internal.constraintvalidators.EANValidator;
-import org.hibernate.validator.internal.constraintvalidators.EmailValidator;
-import org.hibernate.validator.internal.constraintvalidators.FutureValidatorForCalendar;
-import org.hibernate.validator.internal.constraintvalidators.FutureValidatorForDate;
-import org.hibernate.validator.internal.constraintvalidators.FutureValidatorForReadableInstant;
-import org.hibernate.validator.internal.constraintvalidators.FutureValidatorForReadablePartial;
-import org.hibernate.validator.internal.constraintvalidators.LengthValidator;
-import org.hibernate.validator.internal.constraintvalidators.LuhnCheckValidator;
-import org.hibernate.validator.internal.constraintvalidators.MaxValidatorForCharSequence;
-import org.hibernate.validator.internal.constraintvalidators.MaxValidatorForNumber;
-import org.hibernate.validator.internal.constraintvalidators.MinValidatorForCharSequence;
-import org.hibernate.validator.internal.constraintvalidators.MinValidatorForNumber;
-import org.hibernate.validator.internal.constraintvalidators.Mod10CheckValidator;
-import org.hibernate.validator.internal.constraintvalidators.Mod11CheckValidator;
-import org.hibernate.validator.internal.constraintvalidators.ModCheckValidator;
-import org.hibernate.validator.internal.constraintvalidators.NotBlankValidator;
-import org.hibernate.validator.internal.constraintvalidators.NotNullValidator;
-import org.hibernate.validator.internal.constraintvalidators.NullValidator;
-import org.hibernate.validator.internal.constraintvalidators.ParameterScriptAssertValidator;
-import org.hibernate.validator.internal.constraintvalidators.PastValidatorForCalendar;
-import org.hibernate.validator.internal.constraintvalidators.PastValidatorForDate;
-import org.hibernate.validator.internal.constraintvalidators.PastValidatorForReadableInstant;
-import org.hibernate.validator.internal.constraintvalidators.PastValidatorForReadablePartial;
-import org.hibernate.validator.internal.constraintvalidators.PatternValidator;
-import org.hibernate.validator.internal.constraintvalidators.SafeHtmlValidator;
-import org.hibernate.validator.internal.constraintvalidators.ScriptAssertValidator;
-import org.hibernate.validator.internal.constraintvalidators.SizeValidatorForArray;
-import org.hibernate.validator.internal.constraintvalidators.SizeValidatorForArraysOfBoolean;
-import org.hibernate.validator.internal.constraintvalidators.SizeValidatorForArraysOfByte;
-import org.hibernate.validator.internal.constraintvalidators.SizeValidatorForArraysOfChar;
-import org.hibernate.validator.internal.constraintvalidators.SizeValidatorForArraysOfDouble;
-import org.hibernate.validator.internal.constraintvalidators.SizeValidatorForArraysOfFloat;
-import org.hibernate.validator.internal.constraintvalidators.SizeValidatorForArraysOfInt;
-import org.hibernate.validator.internal.constraintvalidators.SizeValidatorForArraysOfLong;
-import org.hibernate.validator.internal.constraintvalidators.SizeValidatorForCharSequence;
-import org.hibernate.validator.internal.constraintvalidators.SizeValidatorForCollection;
-import org.hibernate.validator.internal.constraintvalidators.SizeValidatorForMap;
-import org.hibernate.validator.internal.constraintvalidators.URLValidator;
+import org.hibernate.validator.internal.constraintvalidators.bv.AssertFalseValidator;
+import org.hibernate.validator.internal.constraintvalidators.bv.AssertTrueValidator;
+import org.hibernate.validator.internal.constraintvalidators.bv.DecimalMaxValidatorForCharSequence;
+import org.hibernate.validator.internal.constraintvalidators.bv.DecimalMaxValidatorForNumber;
+import org.hibernate.validator.internal.constraintvalidators.bv.DecimalMinValidatorForCharSequence;
+import org.hibernate.validator.internal.constraintvalidators.bv.DecimalMinValidatorForNumber;
+import org.hibernate.validator.internal.constraintvalidators.bv.DigitsValidatorForCharSequence;
+import org.hibernate.validator.internal.constraintvalidators.bv.DigitsValidatorForNumber;
+import org.hibernate.validator.internal.constraintvalidators.hv.EANValidator;
+import org.hibernate.validator.internal.constraintvalidators.hv.EmailValidator;
+import org.hibernate.validator.internal.constraintvalidators.bv.future.FutureValidatorForCalendar;
+import org.hibernate.validator.internal.constraintvalidators.bv.future.FutureValidatorForChronoLocalDate;
+import org.hibernate.validator.internal.constraintvalidators.bv.future.FutureValidatorForChronoLocalDateTime;
+import org.hibernate.validator.internal.constraintvalidators.bv.future.FutureValidatorForChronoZonedDateTime;
+import org.hibernate.validator.internal.constraintvalidators.bv.future.FutureValidatorForDate;
+import org.hibernate.validator.internal.constraintvalidators.bv.future.FutureValidatorForInstant;
+import org.hibernate.validator.internal.constraintvalidators.bv.future.FutureValidatorForOffsetDateTime;
+import org.hibernate.validator.internal.constraintvalidators.bv.future.FutureValidatorForReadableInstant;
+import org.hibernate.validator.internal.constraintvalidators.bv.future.FutureValidatorForReadablePartial;
+import org.hibernate.validator.internal.constraintvalidators.bv.future.FutureValidatorForYear;
+import org.hibernate.validator.internal.constraintvalidators.bv.future.FutureValidatorForYearMonth;
+import org.hibernate.validator.internal.constraintvalidators.hv.LengthValidator;
+import org.hibernate.validator.internal.constraintvalidators.hv.LuhnCheckValidator;
+import org.hibernate.validator.internal.constraintvalidators.bv.MaxValidatorForCharSequence;
+import org.hibernate.validator.internal.constraintvalidators.bv.MaxValidatorForNumber;
+import org.hibernate.validator.internal.constraintvalidators.bv.MinValidatorForCharSequence;
+import org.hibernate.validator.internal.constraintvalidators.bv.MinValidatorForNumber;
+import org.hibernate.validator.internal.constraintvalidators.hv.Mod10CheckValidator;
+import org.hibernate.validator.internal.constraintvalidators.hv.Mod11CheckValidator;
+import org.hibernate.validator.internal.constraintvalidators.hv.ModCheckValidator;
+import org.hibernate.validator.internal.constraintvalidators.hv.NotBlankValidator;
+import org.hibernate.validator.internal.constraintvalidators.bv.NotNullValidator;
+import org.hibernate.validator.internal.constraintvalidators.bv.NullValidator;
+import org.hibernate.validator.internal.constraintvalidators.hv.ParameterScriptAssertValidator;
+import org.hibernate.validator.internal.constraintvalidators.bv.past.PastValidatorForCalendar;
+import org.hibernate.validator.internal.constraintvalidators.bv.past.PastValidatorForChronoLocalDate;
+import org.hibernate.validator.internal.constraintvalidators.bv.past.PastValidatorForChronoLocalDateTime;
+import org.hibernate.validator.internal.constraintvalidators.bv.past.PastValidatorForChronoZonedDateTime;
+import org.hibernate.validator.internal.constraintvalidators.bv.past.PastValidatorForDate;
+import org.hibernate.validator.internal.constraintvalidators.bv.past.PastValidatorForInstant;
+import org.hibernate.validator.internal.constraintvalidators.bv.past.PastValidatorForOffsetDateTime;
+import org.hibernate.validator.internal.constraintvalidators.bv.past.PastValidatorForReadableInstant;
+import org.hibernate.validator.internal.constraintvalidators.bv.past.PastValidatorForReadablePartial;
+import org.hibernate.validator.internal.constraintvalidators.bv.past.PastValidatorForYear;
+import org.hibernate.validator.internal.constraintvalidators.bv.past.PastValidatorForYearMonth;
+import org.hibernate.validator.internal.constraintvalidators.bv.PatternValidator;
+import org.hibernate.validator.internal.constraintvalidators.hv.SafeHtmlValidator;
+import org.hibernate.validator.internal.constraintvalidators.hv.ScriptAssertValidator;
+import org.hibernate.validator.internal.constraintvalidators.bv.size.SizeValidatorForArray;
+import org.hibernate.validator.internal.constraintvalidators.bv.size.SizeValidatorForArraysOfBoolean;
+import org.hibernate.validator.internal.constraintvalidators.bv.size.SizeValidatorForArraysOfByte;
+import org.hibernate.validator.internal.constraintvalidators.bv.size.SizeValidatorForArraysOfChar;
+import org.hibernate.validator.internal.constraintvalidators.bv.size.SizeValidatorForArraysOfDouble;
+import org.hibernate.validator.internal.constraintvalidators.bv.size.SizeValidatorForArraysOfFloat;
+import org.hibernate.validator.internal.constraintvalidators.bv.size.SizeValidatorForArraysOfInt;
+import org.hibernate.validator.internal.constraintvalidators.bv.size.SizeValidatorForArraysOfLong;
+import org.hibernate.validator.internal.constraintvalidators.bv.size.SizeValidatorForCharSequence;
+import org.hibernate.validator.internal.constraintvalidators.bv.size.SizeValidatorForCollection;
+import org.hibernate.validator.internal.constraintvalidators.bv.size.SizeValidatorForMap;
+import org.hibernate.validator.internal.constraintvalidators.hv.URLValidator;
import org.hibernate.validator.internal.util.Contracts;
import org.hibernate.validator.internal.util.ReflectionHelper;
+import org.hibernate.validator.internal.util.Version;
import org.hibernate.validator.internal.util.logging.Log;
import org.hibernate.validator.internal.util.logging.LoggerFactory;
@@ -160,6 +175,16 @@ public ConstraintHelper() {
constraintList.add( FutureValidatorForReadableInstant.class );
constraintList.add( FutureValidatorForReadablePartial.class );
}
+ if ( Version.getJavaRelease() >= 8 ) {
+ // Java 8 date/time API validators
+ constraintList.add( FutureValidatorForChronoLocalDate.class );
+ constraintList.add( FutureValidatorForChronoLocalDateTime.class );
+ constraintList.add( FutureValidatorForChronoZonedDateTime.class );
+ constraintList.add( FutureValidatorForInstant.class );
+ constraintList.add( FutureValidatorForYear.class );
+ constraintList.add( FutureValidatorForYearMonth.class );
+ constraintList.add( FutureValidatorForOffsetDateTime.class );
+ }
builtinConstraints.put( Future.class, constraintList );
constraintList = newArrayList();
@@ -187,6 +212,16 @@ public ConstraintHelper() {
constraintList.add( PastValidatorForReadableInstant.class );
constraintList.add( PastValidatorForReadablePartial.class );
}
+ if ( Version.getJavaRelease() >= 8 ) {
+ // Java 8 date/time API validators
+ constraintList.add( PastValidatorForChronoLocalDate.class );
+ constraintList.add( PastValidatorForChronoLocalDateTime.class );
+ constraintList.add( PastValidatorForChronoZonedDateTime.class );
+ constraintList.add( PastValidatorForInstant.class );
+ constraintList.add( PastValidatorForYear.class );
+ constraintList.add( PastValidatorForYearMonth.class );
+ constraintList.add( PastValidatorForOffsetDateTime.class );
+ }
builtinConstraints.put( Past.class, constraintList );
constraintList = newArrayList();
View
2 ...in/java/org/hibernate/validator/internal/metadata/descriptor/ParameterDescriptorImpl.java
@@ -80,4 +80,4 @@ public String toString() {
sb.append( '}' );
return sb.toString();
}
-}
+}
View
2 .../org/hibernate/validator/internal/metadata/provider/MetaDataProviderKeyedByClassName.java
@@ -84,4 +84,4 @@ protected void addBeanConfiguration(Class<?> beanClass, BeanConfiguration<?> bea
defaultGroupSequenceProvider
);
}
-}
+}
View
12 engine/src/main/java/org/hibernate/validator/internal/util/Version.java
@@ -34,6 +34,18 @@ public static String getVersionString() {
public static void touch() {
}
+ /**
+ * Returns the Java release for the current runtime
+ *
+ * @return the Java release as an integer (e.g. 8 for Java 8)
+ */
+ public static int getJavaRelease() {
+ // Will return something like 1.8
+ String[] specificationVersion = System.getProperty("java.specification.version").split("\\.");
+
+ return Integer.parseInt(specificationVersion[1]);
+ }
+
// helper class should not have a public constructor
private Version() {
}
View
2 engine/src/test/java/org/hibernate/validator/test/internal/bootstrap/BootstrappingTest.java
@@ -35,7 +35,7 @@
import org.hibernate.validator.HibernateValidator;
import org.hibernate.validator.HibernateValidatorConfiguration;
import org.hibernate.validator.constraints.NotEmpty;
-import org.hibernate.validator.internal.constraintvalidators.NotNullValidator;
+import org.hibernate.validator.internal.constraintvalidators.bv.NotNullValidator;
import org.hibernate.validator.internal.engine.ConfigurationImpl;
import org.hibernate.validator.internal.engine.ValidatorFactoryImpl;
import org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorFactoryImpl;
View
4 ...tvalidators/AssertFalseValidatorTest.java → ...lidators/bv/AssertFalseValidatorTest.java
@@ -14,14 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.test.internal.constraintvalidators;
+package org.hibernate.validator.test.internal.constraintvalidators.bv;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-import org.hibernate.validator.internal.constraintvalidators.AssertFalseValidator;
+import org.hibernate.validator.internal.constraintvalidators.bv.AssertFalseValidator;
/**
* @author Alaa Nassef
View
4 ...ntvalidators/AssertTrueValidatorTest.java → ...alidators/bv/AssertTrueValidatorTest.java
@@ -14,14 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.test.internal.constraintvalidators;
+package org.hibernate.validator.test.internal.constraintvalidators.bv;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-import org.hibernate.validator.internal.constraintvalidators.AssertTrueValidator;
+import org.hibernate.validator.internal.constraintvalidators.bv.AssertTrueValidator;
/**
* @author Alaa Nassef
View
2 ...s/DecimalMinMaxValidatorBoundaryTest.java → ...v/DecimalMinMaxValidatorBoundaryTest.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.test.internal.constraintvalidators;
+package org.hibernate.validator.test.internal.constraintvalidators.bv;
import java.util.Set;
import javax.validation.ConstraintViolation;
View
5 ...s/DigitsValidatorForCharSequenceTest.java → ...v/DigitsValidatorForCharSequenceTest.java
@@ -14,15 +14,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.hibernate.validator.test.internal.constraintvalidators;
+package org.hibernate.validator.test.internal.constraintvalidators.bv;
import javax.validation.constraints.Digits;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+import org.hibernate.validator.testutil.MyCustomStringImpl;
import org.hibernate.validator.testutil.TestForIssue;
-import org.hibernate.validator.internal.constraintvalidators.DigitsValidatorForCharSequence;
+import org.hibernate.validator.internal.constraintvalidators.bv.DigitsValidatorForCharSequence;
import org.hibernate.validator.internal.util.annotationfactory.AnnotationDescriptor;
import org.hibernate.validator.internal.util.annotationfactory.AnnotationFactory;
View
4 ...idators/DigitsValidatorForNumberTest.java → ...tors/bv/DigitsValidatorForNumberTest.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.