return ArticleDTO.class.equals(clazz);
}
@Override
public void validate(Object target, Errors errors) {
ArticleDTO articleDTO = (ArticleDTO) target;
String title = articleDTO.getTitle();
if (ValidateUtil.isEmptyText(title)) {
errors.rejectValue("title", null, "Title should not be empty!");
}
String content = articleDTO.getContent();
if (ValidateUtil.isEmptyText(content)) {
errors.rejectValue("content", null, "Content should not be empty!");
}
}