// Path: src/main/java/com/yyqian/imagine/dto/UserUpdateForm.java
// public class UserUpdateForm {
// 
//   private String email = "";
// 
//   private String about = "";
// 
//   public UserUpdateForm() {
//   }
// 
//   public String getEmail() {
//     return email;
//   }
// 
//   public void setEmail(String email) {
//     this.email = email.trim();
//   }
// 
//   public String getAbout() {
//     return about;
//   }
// 
//   public void setAbout(String about) {
//     this.about = about.trim();
//   }
// 
// }


import com.yyqian.imagine.dto.UserUpdateForm;
import org.apache.commons.validator.routines.EmailValidator;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;
package com.yyqian.imagine.dto.validator;


/**
 * Created by yyqian on 1/8/16.
 */
@Component
public class UserUpdateFormValidator implements Validator {
  @Override
  public boolean supports(Class<?> clazz) {
    return clazz.equals(UserUpdateForm.class);
  }

  @Override
  public void validate(Object target, Errors errors) {
// Path: src/main/java/com/yyqian/imagine/dto/UserUpdateForm.java
// public class UserUpdateForm {
// 
//   private String email = "";
// 
//   private String about = "";
// 
//   public UserUpdateForm() {
//   }
// 
//   public String getEmail() {
//     return email;
//   }
// 
//   public void setEmail(String email) {
//     this.email = email.trim();
//   }
// 
//   public String getAbout() {
//     return about;
//   }
// 
//   public void setAbout(String about) {
//     this.about = about.trim();
//   }
// 
// }


// Path: src/main/java/com/yyqian/imagine/dto/validator/UserUpdateFormValidator.java
import com.yyqian.imagine.dto.UserUpdateForm;
import org.apache.commons.validator.routines.EmailValidator;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;

package com.yyqian.imagine.dto.validator;


/**
 * Created by yyqian on 1/8/16.
 */
@Component
public class UserUpdateFormValidator implements Validator {
  @Override
  public boolean supports(Class<?> clazz) {
    return clazz.equals(UserUpdateForm.class);
  }

  @Override
  public void validate(Object target, Errors errors) {
    UserUpdateForm form = (UserUpdateForm)target;