1 17 18 package org.apache.mailet; 19 20 import javax.mail.MessagingException ; 21 import java.util.Collection ; 22 import java.util.Iterator ; 23 import java.util.Vector ; 24 25 33 public abstract class GenericRecipientMatcher extends GenericMatcher { 34 35 43 public final Collection match(Mail mail) throws MessagingException { 44 Collection matching = new Vector (); 45 for (Iterator i = mail.getRecipients().iterator(); i.hasNext(); ) { 46 MailAddress rec = (MailAddress) i.next(); 47 if (matchRecipient(rec)) { 48 matching.add(rec); 49 } 50 } 51 return matching; 52 } 53 54 61 public abstract boolean matchRecipient(MailAddress recipient) throws MessagingException ; 62 } 63 | Popular Tags |