|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.james.mime4j.message.MessageBuilder
public class MessageBuilder
A ContentHandler
for building an Entity
to be
used in conjunction with a MimeStreamParser
.
Constructor Summary | |
---|---|
MessageBuilder(Entity entity)
|
|
MessageBuilder(Entity entity,
StorageProvider storageProvider)
|
Method Summary | |
---|---|
void |
body(BodyDescriptor bd,
java.io.InputStream is)
Called when the body of a discrete (non-multipart) entity is about to be parsed. |
void |
endBodyPart()
Called when a body part ends. |
void |
endHeader()
Called when there are no more header fields in a message or body part. |
void |
endMessage()
Called when a message ends. |
void |
endMultipart()
Called when the body of an entity has been parsed. |
void |
epilogue(java.io.InputStream is)
Called for the epilogue (whatever comes after the final body part) of a multipart/* entity. |
void |
field(Field field)
Called for each field of a header. |
void |
preamble(java.io.InputStream is)
Called for the preamble (whatever comes before the first body part) of a multipart/* entity. |
void |
raw(java.io.InputStream is)
Unsupported. |
void |
startBodyPart()
Called when a new body part starts inside a multipart/* entity. |
void |
startHeader()
Called when a header (of a message or body part) is about to be parsed. |
void |
startMessage()
Called when a new message starts (a top level message or an embedded rfc822 message). |
void |
startMultipart(BodyDescriptor bd)
Called when the body of a multipart entity is about to be parsed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageBuilder(Entity entity)
public MessageBuilder(Entity entity, StorageProvider storageProvider)
Method Detail |
---|
public void startMessage() throws MimeException
ContentHandler
startMessage
in interface ContentHandler
MimeException
- on processing errorsContentHandler.startMessage()
public void endMessage() throws MimeException
ContentHandler
endMessage
in interface ContentHandler
MimeException
- on processing errorsContentHandler.endMessage()
public void startHeader() throws MimeException
ContentHandler
startHeader
in interface ContentHandler
MimeException
- on processing errorsContentHandler.startHeader()
public void field(Field field) throws MimeException
ContentHandler
field
in interface ContentHandler
field
- the MIME field.
MimeException
- on processing errorsContentHandler.field(Field)
public void endHeader() throws MimeException
ContentHandler
endHeader
in interface ContentHandler
MimeException
- on processing errorsContentHandler.endHeader()
public void startMultipart(BodyDescriptor bd) throws MimeException
ContentHandler
startMultipart
in interface ContentHandler
bd
- encapsulates the values (either read from the
message stream or, if not present, determined implictly
as described in the
MIME rfc:s) of the Content-Type
and
Content-Transfer-Encoding
header fields.
MimeException
- on processing errorsContentHandler.startMultipart(org.apache.james.mime4j.descriptor.BodyDescriptor)
public void body(BodyDescriptor bd, java.io.InputStream is) throws MimeException, java.io.IOException
ContentHandler
body
in interface ContentHandler
bd
- see ContentHandler.startMultipart(BodyDescriptor)
is
- the contents of the body. NOTE: this is the raw body contents
- it will not be decoded if encoded. The bd
parameter should be used to determine how the stream data
should be decoded.
MimeException
- on processing errors
java.io.IOException
- should be thrown on I/O errors.ContentHandler.body(org.apache.james.mime4j.descriptor.BodyDescriptor, java.io.InputStream)
public void endMultipart() throws MimeException
ContentHandler
endMultipart
in interface ContentHandler
MimeException
- on processing errorsContentHandler.endMultipart()
public void startBodyPart() throws MimeException
ContentHandler
multipart/*
entity.
startBodyPart
in interface ContentHandler
MimeException
- on processing errorsContentHandler.startBodyPart()
public void endBodyPart() throws MimeException
ContentHandler
endBodyPart
in interface ContentHandler
MimeException
- on processing errorsContentHandler.endBodyPart()
public void epilogue(java.io.InputStream is) throws MimeException, java.io.IOException
ContentHandler
multipart/*
entity.
epilogue
in interface ContentHandler
is
- used to get the contents of the epilogue.
MimeException
- on processing errors
java.io.IOException
- should be thrown on I/O errors.ContentHandler.epilogue(java.io.InputStream)
public void preamble(java.io.InputStream is) throws MimeException, java.io.IOException
ContentHandler
multipart/*
entity.
preamble
in interface ContentHandler
is
- used to get the contents of the preamble.
MimeException
- on processing errors
java.io.IOException
- should be thrown on I/O errors.ContentHandler.preamble(java.io.InputStream)
public void raw(java.io.InputStream is) throws MimeException, java.io.IOException
raw
in interface ContentHandler
is
- the raw contents of the entity.
MimeException
- on processing errors
java.io.IOException
- should be thrown on I/O errors.ContentHandler.raw(java.io.InputStream)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |