|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.james.mime4j.parser.AbstractContentHandler
org.apache.james.mime4j.message.SimpleContentHandler
public abstract class SimpleContentHandler
Abstract implementation of ContentHandler that automates common tasks. Currently performs header parsing and applies content-transfer decoding to body parts.
| Constructor Summary | |
|---|---|
SimpleContentHandler()
|
|
| 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. |
abstract void |
bodyDecoded(BodyDescriptor bd,
java.io.InputStream is)
Called when the body of a discrete (non-multipart) entity is encountered. |
void |
endHeader()
Called when there are no more header fields in a message or body part. |
void |
field(Field field)
Called for each field of a header. |
abstract void |
headers(Header header)
Called after headers are parsed. |
void |
startHeader()
Called when a header (of a message or body part) is about to be parsed. |
| Methods inherited from class org.apache.james.mime4j.parser.AbstractContentHandler |
|---|
endBodyPart, endMessage, endMultipart, epilogue, preamble, raw, startBodyPart, startMessage, startMultipart |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleContentHandler()
| Method Detail |
|---|
public abstract void headers(Header header)
public abstract void bodyDecoded(BodyDescriptor bd,
java.io.InputStream is)
throws java.io.IOException
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.is - the contents of the body. Base64 or quoted-printable
decoding will be applied transparently.
java.io.IOException - should be thrown on I/O errors.public final void startHeader()
ContentHandler
startHeader in interface ContentHandlerstartHeader in class AbstractContentHandlerAbstractContentHandler.startHeader()
public final void field(Field field)
throws MimeException
ContentHandler
field in interface ContentHandlerfield in class AbstractContentHandlerfield - the MIME field.
MimeException - on processing errorsAbstractContentHandler.field(Field)public final void endHeader()
ContentHandler
endHeader in interface ContentHandlerendHeader in class AbstractContentHandlerAbstractContentHandler.endHeader()
public final void body(BodyDescriptor bd,
java.io.InputStream is)
throws java.io.IOException
ContentHandler
body in interface ContentHandlerbody in class AbstractContentHandlerbd - 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.
java.io.IOException - should be thrown on I/O errors.AbstractContentHandler.body(org.apache.james.mime4j.descriptor.BodyDescriptor, java.io.InputStream)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||