|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectjavax.mail.Multipart
public abstract class Multipart
Multipart は複数の本文部分を保持するコンテナです。 Multipart はサブパートを取り出し、設定するメソッドを提供します。
Multipart は、殆どの Multipart DataContentHandlers により返される コンテンツオブジェクトの基底クラスとしても機能します。 例えば、ソースが "multipart/signed" データソースである DataHandler 上で getContent() を呼び出すと、 Multipart の適切なサブクラスが返されます。
一部のメッセージングシステムは、Multipart の異なるサブタイプを提供します。 例えば、MIME は "alternative"、"mixed"、"related"、"parallel"、 "signed" 等を含む一連のサブタイプを指定します。
Multipart は抽象クラスです。サブクラスは現実の実装を提供します。
| フィールドの概要 | |
|---|---|
protected String |
contentType
このフィールドは、この multipart オブジェクトのコンテンツタイプを指定します。 |
protected Part |
parent
既知の場合、この Multipart を含む Part です。 |
protected Vector |
parts
BodyPart オブジェクトの Vector です。 |
| コンストラクタの概要 | |
|---|---|
protected |
Multipart()
デフォルトのコンストラクタです。 |
| メソッドの概要 | |
|---|---|
void |
addBodyPart(BodyPart part)
マルチパートに Part を追加します。 |
void |
addBodyPart(BodyPart part,
int index)
index の位置に BodyPart を追加します。 |
BodyPart |
getBodyPart(int index)
指定された Part を取得します。 |
String |
getContentType()
この Multipart のコンテンツタイプを返します。 |
int |
getCount()
囲まれた BodyPart オブジェクトの数を返します。 |
Part |
getParent()
この Multipart オブジェクトを含む Part を返します。 |
boolean |
removeBodyPart(BodyPart part)
マルチパートメッセージから、指定された Part を削除します。 |
void |
removeBodyPart(int index)
指定された場所 (0 から開始) の Part を削除します。 |
protected void |
setMultipartDataSource(MultipartDataSource mp)
指定された MultipartDataSource からこの Multipart オブジェクトを設定します。 |
void |
setParent(Part parent)
指定された Part を、この Multipart の親として設定します。 |
abstract void |
writeTo(OutputStream os)
指定された OutputStream に適切にエンコードされたバイトストリームを出力します。 |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
|---|
protected Vector parts
protected String contentType
protected Part parent
Multipart を含む Part です。
| コンストラクタの詳細 |
|---|
protected Multipart()
| メソッドの詳細 |
|---|
protected final void setMultipartDataSource(MultipartDataSource mp)
throws MessagingException
このメソッドは、MultipartDataSource の BodyPart オブジェクトをこの Multipart に追加します。 この Multipart のコンテンツタイプは、MultipartDataSource のコンテンツタイプに設定されます。
一般にこのメソッドは、個別の本文部分に事前解析済みの マルチパートデータソース (IMAP データソース等) があるが、 特定のマルチパートサブタイプを表す適切な Multipart サブクラスを 作成する必要がある場合に使用されます。
mp - Multipart データソース
MessagingExceptionpublic final String getContentType()
この実装は contentType フィールドの値を返すだけです。
contentType
public int getCount()
throws MessagingException
MessagingExceptionparts
public BodyPart getBodyPart(int index)
throws MessagingException
index - 要求する Part のインデックス
IndexOutOfBoundsException - 指定したインデックスが範囲外にある場合
MessagingException
public final boolean removeBodyPart(BodyPart part)
throws MessagingException
part - 削除する Part
MessagingException - そうした Part が存在しない場合
IllegalWriteException - 実装が既存値の変更をサポートしない場合
public final void removeBodyPart(int index)
throws MessagingException
index - 削除する Part のインデックス
MessagingException
IndexOutOfBoundsException - 指定したインデックスが範囲外にある場合
IllegalWriteException - 実装が既存値の変更をサポートしない場合
public void addBodyPart(BodyPart part)
throws MessagingException
part - 追加される Part
MessagingException
IllegalWriteException - 実装が既存値の変更をサポートしない場合
public void addBodyPart(BodyPart part,
int index)
throws MessagingException
index の位置に BodyPart を追加します。
index が一覧中の最後でない場合、後続の Part が 1 つ後ろにずらされます。
index が存在する Part の数よりも大きい場合、BodyPart は終わりに追加されます。
part - 挿入される BodyPartindex - Part を挿入する場所
MessagingException
IllegalWriteException - 実装が既存値の変更をサポートしない場合
public abstract void writeTo(OutputStream os)
throws IOException,
MessagingException
IOException - IO 関連の例外が発生した場合
MessagingExceptionpublic final Part getParent()
Multipart オブジェクトを含む Part を返します。
不明な場合は null を返します。
public final void setParent(Part parent)
Part を、この Multipart の親として設定します。
通常、Message 又は BodyPart の setContent(Multipart) メソッドにより呼び出されます。
Multipart が包含する Part から削除されている場合、
parent は null になることがあります。
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||