com.sssw.srv.mail
Class AgoRFC822HeaderFieldList
java.lang.Object
|
+--com.sssw.srv.mail.AgoRFC822HeaderField
|
+--com.sssw.srv.mail.AgoRFC822HeaderFieldList
- public class AgoRFC822HeaderFieldList
- extends AgoRFC822HeaderField
Class that stores a single RFC 822 header field that is a list of other objects.
For example, the To header field would be stored in an AgRFC822HeaderFieldList
because it may contains multiple addresses.
The AgoRFC822HeaderFieldList class is a subclass
of AgoRFC822HeaderField
. The write() method writes
all the elements of the header field doing line folding as
necessary for long lines. (See RFC 822 for details.)
Method Summary |
void |
add(Object entry)
Adds an Object to the list. |
Enumeration |
elements()
Returns an Enumeration of the elements in the group. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
AgoRFC822HeaderFieldList
public AgoRFC822HeaderFieldList(String fieldname)
- The constructor for the AgoRFC822HeaderFieldList class.
- Parameters:
fieldname
- specifies the name of the header field without
the colon (:).- Example:
AgoRFC822HeaderFieldList hField = new AgoRFC822HeaderFieldList("To");
add
public void add(Object entry)
- Adds an Object to the list.
- Parameters:
entry
- specifies the entry.- Usage:
The Object must implement the toString()
method to correctly format it's text for email. It need not deal with
line wrapping as this class will do that.
- Example:
hField.add(entryObject);
elements
public Enumeration elements()
- Returns an Enumeration of the elements in the group.
- Usage:
Typically, this routine is called for the address headers such as
To, Cc, etc. In these cases, the elements returned are AgoMailAddressMailbox objects.
- Example:
Enumeration e = toField.elements();
while (e.hasMoreElements()) {
AgoMailAddressMailbox mb = (AgoMailAddressMailbox)e.nextElement();
// work with mailbox mb
}