-->
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: property name
PostPosted: Wed Mar 14, 2012 8:11 am 
Newbie

Joined: Wed Mar 14, 2012 8:05 am
Posts: 3
Hibernate validator

Is it possible to obtain the propertyPath or propertyName of the field your are validating in the isValid method?

f.i.
public boolean isValid( Object myObject, ConstraintValidatorContext aContext ) {
LOGGER.debug("Your are validating field: " + propertyName);
}

In the same sence: is there a possibility to obtain the propertyName in the ValidationMessages.properties file just like you obtain f.i. {value}?

thx


Top
 Profile  
 
 Post subject: Re: property name
PostPosted: Thu Mar 15, 2012 5:18 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
janneke wrote:
Hibernate validator
Is it possible to obtain the propertyPath or propertyName of the field your are validating in the isValid method?

No. There is a discussion to include more meta information into the ConstraintValidatorContext for Bean Validation 1.1, but atm it is not possible.

janneke wrote:
Hibernate validator
In the same sence: is there a possibility to obtain the propertyName in the ValidationMessages.properties file just like you obtain f.i. {value}?

Again no. Sorry.

--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.