org.apache.james.mime4j
Class BodyDescriptor

java.lang.Object
  extended by org.apache.james.mime4j.BodyDescriptor

public class BodyDescriptor
extends java.lang.Object

Encapsulates the values of the MIME-specific header fields (which starts with Content-).

Version:
$Id: BodyDescriptor.java,v 1.4 2005/02/11 10:08:37 ntherning Exp $

Constructor Summary
BodyDescriptor()
          Creates a new root BodyDescriptor instance.
BodyDescriptor(BodyDescriptor parent)
          Creates a new BodyDescriptor instance.
 
Method Summary
 void addField(java.lang.String name, java.lang.String value)
          Should be called for each Content- header field of a MIME message or part.
 java.lang.String getBoundary()
          Return the boundary
 java.lang.String getCharset()
          Return the charset
 java.lang.String getMimeType()
          Return the MimeType
 java.util.Map getParameters()
          Return all parameters for the BodyDescriptor
 java.lang.String getTransferEncoding()
          Return the TransferEncoding
 boolean isBase64Encoded()
          Return true if it's base64 encoded
 boolean isMessage()
          Return true if the BodyDescriptor belongs to a message
 boolean isMimeType(java.lang.String mimeType)
           
 boolean isMultipart()
          Retrun true if the BodyDescripotro belogns to a multipart
 boolean isQuotedPrintableEncoded()
          Return true if it's quoted-printable
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BodyDescriptor

public BodyDescriptor()
Creates a new root BodyDescriptor instance.


BodyDescriptor

public BodyDescriptor(BodyDescriptor parent)
Creates a new BodyDescriptor instance.

Parameters:
parent - the descriptor of the parent or null if this is the root descriptor.
Method Detail

addField

public void addField(java.lang.String name,
                     java.lang.String value)
Should be called for each Content- header field of a MIME message or part.

Parameters:
name - the field name.
value - the field value.

isMimeType

public boolean isMimeType(java.lang.String mimeType)

isMessage

public boolean isMessage()
Return true if the BodyDescriptor belongs to a message

Returns:

isMultipart

public boolean isMultipart()
Retrun true if the BodyDescripotro belogns to a multipart

Returns:

getMimeType

public java.lang.String getMimeType()
Return the MimeType

Returns:
mimeType

getBoundary

public java.lang.String getBoundary()
Return the boundary

Returns:
boundary

getCharset

public java.lang.String getCharset()
Return the charset

Returns:
charset

getParameters

public java.util.Map getParameters()
Return all parameters for the BodyDescriptor

Returns:
parameters

getTransferEncoding

public java.lang.String getTransferEncoding()
Return the TransferEncoding

Returns:
transferEncoding

isBase64Encoded

public boolean isBase64Encoded()
Return true if it's base64 encoded

Returns:

isQuotedPrintableEncoded

public boolean isQuotedPrintableEncoded()
Return true if it's quoted-printable

Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2004-2007 The Apache Software Foundation. All Rights Reserved.