-package com.ozacc.mail.mailet;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Iterator;\r
-import java.util.List;\r
-\r
-import com.ozacc.mail.fetch.ReceivedMail;\r
-\r
-/**\r
- * MailetインスタンスとMatcherインスタンスのリストを持つMailetの実行単位となるクラス。\r
- * \r
- * @since 1.2\r
- * @author Tomohiro Otsuka\r
- * @version $Id: MailetWrapper.java,v 1.1.2.2 2005/01/23 06:47:01 otsuka Exp $\r
- */\r
-public class MailetWrapper {\r
-\r
- private Mailet mailet;\r
-\r
- private List matcherList;\r
-\r
- /**\r
- * コンストラクタ。\r
- */\r
- public MailetWrapper() {\r
- matcherList = new ArrayList();\r
- }\r
-\r
- /**\r
- * コンストラクタ。\r
- * \r
- * @param mailet Mailetインスタンス\r
- * @param matcherList Matcherインスタンスのリスト\r
- */\r
- public MailetWrapper(Mailet mailet, List matcherList) {\r
- this();\r
- this.mailet = mailet;\r
- this.matcherList = matcherList;\r
- }\r
-\r
- /**\r
- * リストされているMatcherの条件をクリアしたMailetを実行します。\r
- * \r
- * @param mail 受信メール\r
- */\r
- public void execute(ReceivedMail mail) {\r
- for (Iterator itr = matcherList.iterator(); itr.hasNext();) {\r
- Matcher m = (Matcher)itr.next();\r
- if (!m.match(mail)) {\r
- return;\r
- }\r
- }\r
- mailet.service(mail);\r
- }\r
-\r
- /**\r
- * Mailetインスタンスを返します。\r
- * \r
- * @return Mailetインスタンス\r
- */\r
- public Mailet getMailet() {\r
- return mailet;\r
- }\r
-\r
- /**\r
- * Mailetインスタンスをセットします。\r
- * \r
- * @param mailet Mailetインスタンス\r
- */\r
- public void setMailet(Mailet mailet) {\r
- this.mailet = mailet;\r
- }\r
-\r
- /**\r
- * Matcherインスタンスのリストを返します。\r
- * \r
- * @return Matcherインスタンスのリスト\r
- */\r
- public List getMatcherList() {\r
- return matcherList;\r
- }\r
-\r
- /**\r
- * Matcherインスタンスのリストをセットします。\r
- * \r
- * @param matcherList Matcherインスタンスのリスト\r
- */\r
- public void setMatcherList(List matcherList) {\r
- this.matcherList = matcherList;\r
- }\r
+package com.ozacc.mail.mailet;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import com.ozacc.mail.fetch.ReceivedMail;
+
+/**
+ * MailetインスタンスとMatcherインスタンスのリストを持つMailetの実行単位となるクラス。
+ *
+ * @since 1.2
+ * @author Tomohiro Otsuka
+ * @version $Id: MailetWrapper.java,v 1.1.2.2 2005/01/23 06:47:01 otsuka Exp $
+ */
+public class MailetWrapper {
+
+ private Mailet mailet;
+
+ private List matcherList;
+
+ /**
+ * コンストラクタ。
+ */
+ public MailetWrapper() {
+ matcherList = new ArrayList();
+ }
+
+ /**
+ * コンストラクタ。
+ *
+ * @param mailet Mailetインスタンス
+ * @param matcherList Matcherインスタンスのリスト
+ */
+ public MailetWrapper(Mailet mailet, List matcherList) {
+ this();
+ this.mailet = mailet;
+ this.matcherList = matcherList;
+ }
+
+ /**
+ * リストされているMatcherの条件をクリアしたMailetを実行します。
+ *
+ * @param mail 受信メール
+ */
+ public void execute(ReceivedMail mail) {
+ for (Iterator itr = matcherList.iterator(); itr.hasNext();) {
+ Matcher m = (Matcher)itr.next();
+ if (!m.match(mail)) {
+ return;
+ }
+ }
+ mailet.service(mail);
+ }
+
+ /**
+ * Mailetインスタンスを返します。
+ *
+ * @return Mailetインスタンス
+ */
+ public Mailet getMailet() {
+ return mailet;
+ }
+
+ /**
+ * Mailetインスタンスをセットします。
+ *
+ * @param mailet Mailetインスタンス
+ */
+ public void setMailet(Mailet mailet) {
+ this.mailet = mailet;
+ }
+
+ /**
+ * Matcherインスタンスのリストを返します。
+ *
+ * @return Matcherインスタンスのリスト
+ */
+ public List getMatcherList() {
+ return matcherList;
+ }
+
+ /**
+ * Matcherインスタンスのリストをセットします。
+ *
+ * @param matcherList Matcherインスタンスのリスト
+ */
+ public void setMatcherList(List matcherList) {
+ this.matcherList = matcherList;
+ }
}
\ No newline at end of file