org.apache.mailet
Class GenericRecipientMatcher
java.lang.Object
org.apache.mailet.GenericMatcher
org.apache.mailet.GenericRecipientMatcher
- All Implemented Interfaces:
- Matcher, MatcherConfig
- Direct Known Subclasses:
- CommandForListserv, CommandListservMatcher, HostIs, HostIsLocal, RecipientIs, RecipientIsLocal, RecipientIsRegex, UserIs
public abstract class GenericRecipientMatcher
- extends GenericMatcher
GenericMatcher makes writing recipient based matchers easier. It provides
simple versions of the lifecycle methods init and destroy and of the methods
in the MatcherConfig interface. GenericMatcher also implements the log method,
declared in the MatcherContext interface.
- Version:
- 1.0.0, 24/04/1999
Method Summary |
java.util.Collection |
match(Mail mail)
Matches each recipient one by one through matchRecipient(MailAddress
recipient) method. |
abstract boolean |
matchRecipient(MailAddress recipient)
Simple check to match exclusively on the email address (not
message information). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GenericRecipientMatcher
public GenericRecipientMatcher()
match
public final java.util.Collection match(Mail mail)
throws javax.mail.MessagingException
- Matches each recipient one by one through matchRecipient(MailAddress
recipient) method. Handles splitting the recipients Collection
as appropriate.
- Specified by:
match
in interface Matcher
- Specified by:
match
in class GenericMatcher
- Parameters:
mail
- - the message and routing information to determine whether to match
- Returns:
- Collection the Collection of MailAddress objects that have been matched
- Throws:
MessagingException
- - if an message or address parsing exception occurs or
an exception that interferes with the matcher's normal operation
matchRecipient
public abstract boolean matchRecipient(MailAddress recipient)
throws javax.mail.MessagingException
- Simple check to match exclusively on the email address (not
message information).
- Parameters:
recipient
- - the address to determine whether to match
- Returns:
- boolean whether the recipient is a match
- Throws:
javax.mail.MessagingException
Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.