|
Apache JAMES Mime4j 0.6-redhat-2 | |||||||||
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,
InputStream is)
Called when the body of a discrete (non-multipart) entity is about to be parsed. |
abstract void |
bodyDecoded(BodyDescriptor bd,
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, InputStream is) throws 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.
IOException
- should be thrown on I/O errors.public final void startHeader()
ContentHandler
startHeader
in interface ContentHandler
startHeader
in class AbstractContentHandler
AbstractContentHandler.startHeader()
public final void field(Field field) throws MimeException
ContentHandler
field
in interface ContentHandler
field
in class AbstractContentHandler
field
- the MIME field.
MimeException
- on processing errorsAbstractContentHandler.field(Field)
public final void endHeader()
ContentHandler
endHeader
in interface ContentHandler
endHeader
in class AbstractContentHandler
AbstractContentHandler.endHeader()
public final void body(BodyDescriptor bd, InputStream is) throws IOException
ContentHandler
body
in interface ContentHandler
body
in class AbstractContentHandler
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.
IOException
- should be thrown on I/O errors.AbstractContentHandler.body(org.apache.james.mime4j.descriptor.BodyDescriptor, java.io.InputStream)
|
Apache JAMES Mime4j 0.6-redhat-2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |