Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem In Validator Interface  RSS feed

 
Abhra Kar
Ranch Hand
Posts: 159
  • 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: 672
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: 159
  • 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: 672
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: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help
I will go through it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!