From markus at malkusch.de Thu Mar 27 01:27:54 2014 From: markus at malkusch.de (Markus Malkusch) Date: Thu, 27 Mar 2014 14:27:54 +0900 Subject: [bv-dev] [Java 8] How about support java.time in @Future and @Past? Message-ID: <2620991.mzq0bCMW3M@laerz> Dear bean validation Java bean validation 1.1 @Future and @Past constraints are restricted to Calendar and Date only. Adding custom validators for Java 8's java.time types is possible as described in 8.1.2. Overriding constraint definitions in XML. But I'm just too lazy to do this for my own. I would love to see a new spec which includes the Java 8's java.time classes. Sincerly Markus Malkusch -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. Url : http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20140327/8caf51e7/attachment.bin From hardy at hibernate.org Thu Mar 27 07:12:22 2014 From: hardy at hibernate.org (Hardy Ferentschik) Date: Thu, 27 Mar 2014 12:12:22 +0100 Subject: [bv-dev] [Java 8] How about support java.time in @Future and @Past? In-Reply-To: <2620991.mzq0bCMW3M@laerz> References: <2620991.mzq0bCMW3M@laerz> Message-ID: <89950D9B-0D70-458E-8201-8C9C2C399A66@hibernate.org> Hi Markus, thanks for your feedback. Supporting new Java 8 data types seems to be a good candidate for the next iteration of the Bean Validation spec. If this version will align with Java 8, there are other candidates as well. For example the ability to annotate collection elements (List<@Min(4) String> foo) or handling the validation of @Optional values. At the moment the plan for an new spec release are still in the making. However, in Hibenrate Validator we already started the work on supporting Java 8 [1], including the new date and time types [2]. Hibernate Validator 5.2 should make this functionality available, probably well before there will be a new spec version. Once HV 5.2 is available you should be able to upgrade even without a new version of the Bean Validation spec. ?Hardy [1] https://hibernate.atlassian.net/browse/HV-825 [2] https://hibernate.atlassian.net/browse/HV-874 On 27 Jan 2014, at 06:27, Markus Malkusch wrote: > Dear bean validation > > Java bean validation 1.1 @Future and @Past constraints are restricted to > Calendar and Date only. Adding custom validators for Java 8's java.time types > is possible as described in 8.1.2. Overriding constraint definitions in XML. > But I'm just too lazy to do this for my own. I would love to see a new spec > which includes the Java 8's java.time classes. > > Sincerly Markus Malkusch_______________________________________________ > beanvalidation-dev mailing list > beanvalidation-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/beanvalidation-dev From gunnar at hibernate.org Mon Mar 31 04:07:08 2014 From: gunnar at hibernate.org (Gunnar Morling) Date: Mon, 31 Mar 2014 10:07:08 +0200 Subject: [bv-dev] [Java 8] How about support java.time in @Future and @Past? In-Reply-To: <89950D9B-0D70-458E-8201-8C9C2C399A66@hibernate.org> References: <2620991.mzq0bCMW3M@laerz> <89950D9B-0D70-458E-8201-8C9C2C399A66@hibernate.org> Message-ID: As Hardy said, these new data types should be supported in the next BV revision. HV-825 is our testing bed for bringing the new functionalities from Java 8 to the world of Bean Validation; If you have any ideas around this make sure to let us know. Related to that, I think it should be simpler to add additional constraints in a "global" manner than it is today. One possible way would be to support registering validator implementations using the service loader SPI, by providing a file META-INF/services/javax.validation.ConstraintValidator which lists additional implementations. This avoids the XML and allows to add a JAR with validators to an application without further need for registration. --Gunnar 2014-03-27 12:12 GMT+01:00 Hardy Ferentschik : > Hi Markus, > > thanks for your feedback. Supporting new Java 8 data types seems to be a > good candidate for > the next iteration of the Bean Validation spec. If this version will align > with Java 8, there are other > candidates as well. For example the ability to annotate collection > elements (List<@Min(4) String> foo) > or handling the validation of @Optional values. > > At the moment the plan for an new spec release are still in the making. > However, in Hibenrate Validator > we already started the work on supporting Java 8 [1], including the new > date and time types [2]. > Hibernate Validator 5.2 should make this functionality available, probably > well before there will be a new spec version. > Once HV 5.2 is available you should be able to upgrade even without a new > version of the Bean Validation spec. > > --Hardy > > [1] https://hibernate.atlassian.net/browse/HV-825 > [2] https://hibernate.atlassian.net/browse/HV-874 > > > > > On 27 Jan 2014, at 06:27, Markus Malkusch wrote: > > > Dear bean validation > > > > Java bean validation 1.1 @Future and @Past constraints are restricted to > > Calendar and Date only. Adding custom validators for Java 8's java.time > types > > is possible as described in 8.1.2. Overriding constraint definitions in > XML. > > But I'm just too lazy to do this for my own. I would love to see a new > spec > > which includes the Java 8's java.time classes. > > > > Sincerly Markus Malkusch_______________________________________________ > > beanvalidation-dev mailing list > > beanvalidation-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/beanvalidation-dev > > > _______________________________________________ > beanvalidation-dev mailing list > beanvalidation-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/beanvalidation-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20140331/932f61cc/attachment.html From hardy at hibernate.org Mon Mar 31 05:45:28 2014 From: hardy at hibernate.org (Hardy Ferentschik) Date: Mon, 31 Mar 2014 11:45:28 +0200 Subject: [bv-dev] [Java 8] How about support java.time in @Future and @Past? In-Reply-To: References: <2620991.mzq0bCMW3M@laerz> <89950D9B-0D70-458E-8201-8C9C2C399A66@hibernate.org> Message-ID: <1FFB319E-35B9-46C4-8CBE-560E190044DB@hibernate.org> On 31 Jan 2014, at 10:07, Gunnar Morling wrote: > Related to that, I think it should be simpler to add additional constraints in a "global" manner than it is today. One possible way would be to support registering validator implementations using the service loader SPI, by providing a file META-INF/services/javax.validation.ConstraintValidator which lists additional implementations. This avoids the XML and allows to add a JAR with validators to an application without further need for registration. +1 It?s probably another thing we will experiment with for HV 5.2