⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subscribevalidator.java.svn-base

📁 google的开源项目
💻 SVN-BASE
字号:
package com.google.code.rsser.web.validator;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.validation.Errors;import org.springframework.validation.Validator;import com.google.code.rsser.model.Feed;import com.google.code.rsser.service.FeedService;import com.google.code.rsser.service.UserService;public class SubscribeValidator implements Validator{	@Autowired	protected FeedService feedService;		@Autowired	protected UserService userService;		public boolean supports(Class clazz) {		return Feed.class.equals(clazz);	}	public void validate(Object obj, Errors errors) {		Feed feed = (Feed) obj;				if (feedService.isFeedSubscribed(userService.getCurrent(), feed.getFeedUrl())) {			errors.reject("subscription.alreadySubscribed");		}	}	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -