public abstract class AbstractMultipart extends java.lang.Object implements Multipart
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<Entity> |
bodyParts |
| Constructor and Description |
|---|
AbstractMultipart(java.lang.String subType)
Creates a new empty
Multipart instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
addBodyPart(Entity bodyPart)
Adds a body part to the end of the list of body parts.
|
void |
addBodyPart(Entity bodyPart,
int index)
Inserts a body part at the specified position in the list of body parts.
|
void |
dispose()
Disposes of the BodyParts of this Multipart.
|
java.util.List<Entity> |
getBodyParts()
Gets the list of body parts.
|
int |
getCount()
Returns the number of body parts.
|
abstract java.lang.String |
getEpilogue()
Gets the epilogue or null if the message has no epilogue
|
Entity |
getParent()
Gets the parent of this body.
|
abstract java.lang.String |
getPreamble()
Gets the preamble or null if the message has no preamble.
|
java.lang.String |
getSubType()
Gets the multipart sub-type.
|
Entity |
removeBodyPart(int index)
Removes the body part at the specified position in the list of body
parts.
|
Entity |
replaceBodyPart(Entity bodyPart,
int index)
Replaces the body part at the specified position in the list of body
parts with the specified body part.
|
void |
setBodyParts(java.util.List<Entity> bodyParts)
Sets the list of body parts.
|
abstract void |
setEpilogue(java.lang.String epilogue)
Sets the epilogue value, or remove it if the value passed is null.
|
void |
setParent(Entity parent)
Sets the parent of this body.
|
abstract void |
setPreamble(java.lang.String preamble)
Sets the preamble with a value or null to remove the preamble.
|
void |
setSubType(java.lang.String subType)
Sets the multipart sub-type.
|
protected java.util.List<Entity> bodyParts
public AbstractMultipart(java.lang.String subType)
Multipart instance.public java.lang.String getSubType()
alternative (the
default) or parallel. See RFC 2045 for common sub-types
and their meaning.getSubType in interface Multipartpublic void setSubType(java.lang.String subType)
alternative or
parallel. See RFC 2045 for common sub-types and their
meaning.subType - the sub-type.public Entity getParent()
BodygetParent in interface BodyBody.getParent()public void setParent(Entity parent)
BodysetParent in interface Bodyparent - the parent.Body.setParent(org.apache.james.mime4j.dom.Entity)public int getCount()
public java.util.List<Entity> getBodyParts()
getBodyParts in interface MultipartEntity objects.public void setBodyParts(java.util.List<Entity> bodyParts)
setBodyParts in interface MultipartbodyParts - the new list of Entity objects.public void addBodyPart(Entity bodyPart)
addBodyPart in interface MultipartbodyPart - the body part.public void addBodyPart(Entity bodyPart, int index)
addBodyPart in interface MultipartbodyPart - the body part.index - index at which the specified body part is to be inserted.java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >
getCount()).public Entity removeBodyPart(int index)
removeBodyPart in interface Multipartindex - index of the body part to be removed.java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >=
getCount()).public Entity replaceBodyPart(Entity bodyPart, int index)
replaceBodyPart in interface MultipartbodyPart - body part to be stored at the specified position.index - index of body part to replace.java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >=
getCount()).public abstract java.lang.String getPreamble()
getPreamble in interface Multipartpublic abstract void setPreamble(java.lang.String preamble)
setPreamble in interface Multipartpreamble - the preamble.public abstract java.lang.String getEpilogue()
getEpilogue in interface Multipartpublic abstract void setEpilogue(java.lang.String epilogue)
setEpilogue in interface Multipartepilogue - the epilogue.public void dispose()
dispose in interface DisposableDisposable.dispose()