| %line | %branch | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| com.ozacc.mail.mailet.MailetWrapper |
|
|
| 1 | package com.ozacc.mail.mailet; |
|
| 2 | ||
| 3 | import java.util.ArrayList; |
|
| 4 | import java.util.Iterator; |
|
| 5 | import java.util.List; |
|
| 6 | ||
| 7 | import com.ozacc.mail.fetch.ReceivedMail; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * Mailet¥¤¥ó¥¹¥¿¥ó¥¹¤ÈMatcher¥¤¥ó¥¹¥¿¥ó¥¹¤Î¥?¥¹¥È¤ò»?¤ÄMailet¤Î¼Â¹Ôñ°Ì¤È¤Ê¤?¥¯¥é¥¹¡£ |
|
| 11 | * |
|
| 12 | * @since 1.2 |
|
| 13 | * @author Tomohiro Otsuka |
|
| 14 | * @version $Id: MailetWrapper.java,v 1.1.2.2 2005/01/23 06:47:01 otsuka Exp $ |
|
| 15 | */ |
|
| 16 | public class MailetWrapper { |
|
| 17 | ||
| 18 | private Mailet mailet; |
|
| 19 | ||
| 20 | private List matcherList; |
|
| 21 | ||
| 22 | /** |
|
| 23 | * ¥³¥ó¥¹¥È¥é¥¯¥¿¡£ |
|
| 24 | */ |
|
| 25 | 0 | public MailetWrapper() { |
| 26 | 0 | matcherList = new ArrayList(); |
| 27 | 0 | } |
| 28 | ||
| 29 | /** |
|
| 30 | * ¥³¥ó¥¹¥È¥é¥¯¥¿¡£ |
|
| 31 | * |
|
| 32 | * @param mailet Mailet¥¤¥ó¥¹¥¿¥ó¥¹ |
|
| 33 | * @param matcherList Matcher¥¤¥ó¥¹¥¿¥ó¥¹¤Î¥?¥¹¥È |
|
| 34 | */ |
|
| 35 | public MailetWrapper(Mailet mailet, List matcherList) { |
|
| 36 | 0 | this(); |
| 37 | 0 | this.mailet = mailet; |
| 38 | 0 | this.matcherList = matcherList; |
| 39 | 0 | } |
| 40 | ||
| 41 | /** |
|
| 42 | * ¥?¥¹¥È¤µ¤?¤Æ¤¤¤?Matcher¤Î¾ò·?¤ò¥¯¥?¥¢¤·¤¿Mailet¤ò¼Â¹Ô¤·¤Þ¤¹¡£ |
|
| 43 | * |
|
| 44 | * @param mail ¼õ¿®¥á¡¼¥? |
|
| 45 | */ |
|
| 46 | public void execute(ReceivedMail mail) { |
|
| 47 | 0 | for (Iterator itr = matcherList.iterator(); itr.hasNext();) { |
| 48 | 0 | Matcher m = (Matcher)itr.next(); |
| 49 | 0 | if (!m.match(mail)) { |
| 50 | 0 | return; |
| 51 | } |
|
| 52 | } |
|
| 53 | 0 | mailet.service(mail); |
| 54 | 0 | } |
| 55 | ||
| 56 | /** |
|
| 57 | * Mailet¥¤¥ó¥¹¥¿¥ó¥¹¤òÊÖ¤·¤Þ¤¹¡£ |
|
| 58 | * |
|
| 59 | * @return Mailet¥¤¥ó¥¹¥¿¥ó¥¹ |
|
| 60 | */ |
|
| 61 | public Mailet getMailet() { |
|
| 62 | 0 | return mailet; |
| 63 | } |
|
| 64 | ||
| 65 | /** |
|
| 66 | * Mailet¥¤¥ó¥¹¥¿¥ó¥¹¤ò¥»¥Ã¥È¤·¤Þ¤¹¡£ |
|
| 67 | * |
|
| 68 | * @param mailet Mailet¥¤¥ó¥¹¥¿¥ó¥¹ |
|
| 69 | */ |
|
| 70 | public void setMailet(Mailet mailet) { |
|
| 71 | 0 | this.mailet = mailet; |
| 72 | 0 | } |
| 73 | ||
| 74 | /** |
|
| 75 | * Matcher¥¤¥ó¥¹¥¿¥ó¥¹¤Î¥?¥¹¥È¤òÊÖ¤·¤Þ¤¹¡£ |
|
| 76 | * |
|
| 77 | * @return Matcher¥¤¥ó¥¹¥¿¥ó¥¹¤Î¥?¥¹¥È |
|
| 78 | */ |
|
| 79 | public List getMatcherList() { |
|
| 80 | 0 | return matcherList; |
| 81 | } |
|
| 82 | ||
| 83 | /** |
|
| 84 | * Matcher¥¤¥ó¥¹¥¿¥ó¥¹¤Î¥?¥¹¥È¤ò¥»¥Ã¥È¤·¤Þ¤¹¡£ |
|
| 85 | * |
|
| 86 | * @param matcherList Matcher¥¤¥ó¥¹¥¿¥ó¥¹¤Î¥?¥¹¥È |
|
| 87 | */ |
|
| 88 | public void setMatcherList(List matcherList) { |
|
| 89 | 0 | this.matcherList = matcherList; |
| 90 | 0 | } |
| 91 | } |
| This report is generated by jcoverage, Maven and Maven JCoverage Plugin. |