- java.lang.Object
-
- javax.mail.Message.RecipientType
-
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- MimeMessage.RecipientType
- Enclosing class:
- Message
public static class Message.RecipientType extends Object implements Serializable
This inner class defines the types of recipients allowed by the Message class. The currently defined types are TO, CC and BCC. Note that this class only has a protected constructor, thereby restricting new Recipient types to either this class or subclasses. This effectively implements an enumeration of the allowed Recipient types. The following code sample shows how to use this class to obtain the "TO" recipients from a message.Message msg = folder.getMessages(1); Address[] a = m.getRecipients(Message.RecipientType.TO);
-
-
Field Summary
Fields Modifier and Type Field and Description static Message.RecipientType
BCC
The "Bcc" (blind carbon copy) recipients.static Message.RecipientType
CC
The "Cc" (carbon copy) recipients.static Message.RecipientType
TO
The "To" (primary) recipients.protected String
type
The type of recipient, usually the name of a corresponding Internet standard header.
-
Constructor Summary
Constructors Modifier Constructor and Description protected
RecipientType(String type)
Constructor for use by subclasses.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description protected Object
readResolve()
When deserializing a RecipientType, we need to make sure to return only one of the known static final instances defined in this class.String
toString()
-
-
-
Field Detail
-
TO
public static final Message.RecipientType TO
The "To" (primary) recipients.
-
CC
public static final Message.RecipientType CC
The "Cc" (carbon copy) recipients.
-
BCC
public static final Message.RecipientType BCC
The "Bcc" (blind carbon copy) recipients.
-
type
protected String type
The type of recipient, usually the name of a corresponding Internet standard header.
-
-
Constructor Detail
-
RecipientType
protected RecipientType(String type)
Constructor for use by subclasses.
-
-
Method Detail
-
readResolve
protected Object readResolve() throws ObjectStreamException
When deserializing a RecipientType, we need to make sure to return only one of the known static final instances defined in this class. Subclasses must implement their ownreadResolve
method that checks for their known instances before calling this super method.- Throws:
ObjectStreamException
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
21/08/2025 17:20:13 Cette version de la page est en cache (à la date du 21/08/2025 17:20:13) afin d'accélérer le traitement.Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.
Document créé le 14/04/2008, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/mail/message.recipienttype.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.