01: package org.concern.library.mail;
02:
03: import org.concern.controller.AbstractCondition;
04:
05: import javax.mail.MessagingException;
06: import javax.mail.internet.MimeMessage;
07:
08: public class ContainsCustomFlag extends AbstractCondition {
09:
10: public boolean eval(Object subject) {
11: return eval((MimeMessage) subject);
12: }
13:
14: public boolean eval(MimeMessage subject) {
15: try {
16: return subject.getFlags().contains(getFlag());
17: } catch (MessagingException e) {
18: e.printStackTrace();
19: return false;
20: }
21: }
22:
23: private String getFlag() {
24: return (String) environment.get("flag");
25: }
26: }
|