This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem In Validator Interface

 
Abhra Kar
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the role of supports() in Validator.
I use a supports() like this ---

@Override
public boolean supports(Class<?> clazz) {
//return User.class.isAssignableFrom(clazz);
return User.class.equals(clazz);

//return false;
}

In this method body what does "isAssignableFrom(clazz);" do.

please provide me some links from where I can understand the Validator interface fully
 
Prasad Krishnegowda
Ranch Hand
Posts: 670
4
Eclipse IDE Java Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
supports method tells you whether this validator supports the validations for the field in the specified class..
 
Abhra Kar
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
THanks
can you give me some links from where I will get complete ideas of spring validation

 
Prasad Krishnegowda
Ranch Hand
Posts: 670
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spring official documentation is well written..
here it is http://static.springsource.org/spring/docs/3.0.x/reference/validation.html
 
Abhra Kar
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help
I will go through it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic