-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Possible to get validation group(s) in validation class?
PostPosted: Wed Oct 14, 2009 1:52 pm 
Newbie

Joined: Wed Oct 14, 2009 1:41 pm
Posts: 1
Is it possible to determine which validation group(s) the validator was called with from within my constraint validator class?

For instance, if I have:

Code:
@ValidFoo
public class Foo
{
}


and I call:
Code:
validator.validate (myFoo, MyGroup.class);


can I determine in my ValidFooValidator that the validator was called with the MyGroup.class validation group? I'm not seeing a way of getting this information from the ConstraintValidatorContext.


Top
 Profile  
 
 Post subject: Re: Possible to get validation group(s) in validation class?
PostPosted: Thu Oct 15, 2009 3:22 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

you are right, there is no way to determine in a ConstraintValidator which group gets evaluated at the moment. I don't think that it would be a good idea either. Groups and constraint validators should not know of each other. These concepts are orthogonal.

--Hardy


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.