Jwma

dtw.webmail.model
Class JwmaMessagePartImpl

java.lang.Object
  |
  +--dtw.webmail.model.JwmaMessagePartImpl
All Implemented Interfaces:
JwmaMessagePart

public class JwmaMessagePartImpl
extends java.lang.Object
implements JwmaMessagePart

Class implementing the JwmaMessagePart model.

Version:
0.9.7 07/02/2003
Author:
Dieter Wimberger

Method Summary
static JwmaMessagePartImpl createJwmaMessagePartImpl(int number)
          Creates a JwmaMessagePartImpl instance with a given part number.
static JwmaMessagePartImpl createJwmaMessagePartImpl(javax.mail.Part part, int number)
          Creates a JwmaMessagePartImpl instance from a given javax.mail.Part instance.
 java.lang.String getContentType()
          Returns a String representing the content type of this message part.
 java.lang.String getDescription()
          Returns a String representing the description of this message part.
 java.lang.String getName()
          Returns a String representing the name of this message part.
 javax.mail.Part getPart()
          Gets the javax.mail.Part wrapped by this instance.
 int getPartNumber()
          Returns an int representing the number of this message part.
 int getSize()
          Returns an int representing the size of this message part in bytes.
 java.lang.String getTextContent()
           
 boolean isMimeType(java.lang.String type)
          Tests if this JwmaMessagePart is of the given type.
 void setContentType(java.lang.String type)
          Sets the content-type (mime) of this JwmaMessagePart.
 void setDescription(java.lang.String description)
          Sets the description of this JwmaMessagePart.
 void setName(java.lang.String name)
          Sets the name of this JwmaMessagePart.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPartNumber

public int getPartNumber()
Description copied from interface: JwmaMessagePart
Returns an int representing the number of this message part.

This number is the unique identifier for a part of a message.

Specified by:
getPartNumber in interface JwmaMessagePart
Returns:
the number of this message part.

isMimeType

public boolean isMimeType(java.lang.String type)
Description copied from interface: JwmaMessagePart
Tests if this JwmaMessagePart is of the given type.

Specified by:
isMimeType in interface JwmaMessagePart
Parameters:
type - the Mime type as String.

getContentType

public java.lang.String getContentType()
Description copied from interface: JwmaMessagePart
Returns a String representing the content type of this message part.

Specified by:
getContentType in interface JwmaMessagePart
Returns:
the content type of this message part as String.

getPart

public javax.mail.Part getPart()
Gets the javax.mail.Part wrapped by this instance.

Returns:
the wrapped part instance.

getTextContent

public java.lang.String getTextContent()

setContentType

public void setContentType(java.lang.String type)
Sets the content-type (mime) of this JwmaMessagePart.

Parameters:
type - the content type of this JwmaMessagePart as String.

getSize

public int getSize()
Description copied from interface: JwmaMessagePart
Returns an int representing the size of this message part in bytes.

Specified by:
getSize in interface JwmaMessagePart
Returns:
the size of this message part in bytes.

getName

public java.lang.String getName()
Description copied from interface: JwmaMessagePart
Returns a String representing the name of this message part.

Specified by:
getName in interface JwmaMessagePart
Returns:
name of this message part as String.

setName

public void setName(java.lang.String name)
Sets the name of this JwmaMessagePart.

Parameters:
name - the name of this JwmaMessagePart as String.

getDescription

public java.lang.String getDescription()
Description copied from interface: JwmaMessagePart
Returns a String representing the description of this message part.

Specified by:
getDescription in interface JwmaMessagePart
Returns:
description of this message part as String.

setDescription

public void setDescription(java.lang.String description)
Sets the description of this JwmaMessagePart.

Parameters:
description - of this JwmaMessagePart as String.

createJwmaMessagePartImpl

public static JwmaMessagePartImpl createJwmaMessagePartImpl(javax.mail.Part part,
                                                            int number)
                                                     throws JwmaException
Creates a JwmaMessagePartImpl instance from a given javax.mail.Part instance.

Parameters:
part - a javax.mail.Part instance.
number - the number of the part as int.
Returns:
the newly created instance.
Throws:
JwmaException - if it fails to create the new instance.

createJwmaMessagePartImpl

public static JwmaMessagePartImpl createJwmaMessagePartImpl(int number)
Creates a JwmaMessagePartImpl instance with a given part number.

Parameters:
number - the number of the part as int.
Returns:
the newly created instance.

Jwma

Copyright © 2000-2003 jwma team (All Rights Reserved.)