org.jasen.core
Class JasenMessageWrapper

java.lang.Object
  extended byorg.jasen.core.JasenMessageWrapper
All Implemented Interfaces:
JasenMessage, Serializable

public class JasenMessageWrapper
extends Object
implements JasenMessage

Internally wraps a parsed JasenMessage.

Author:
Jason Polites
See Also:
Serialized Form

Constructor Summary
JasenMessageWrapper(JasenMessage source)
           
 
Method Summary
 String[] getAttachmentNames()
          Returns the names of all attachments in the message
 Jasen getEngine()
          Gets the current engine instance into which this wrapper was injected.
 String getEnvelopeSender()
           Returns the "envelope" sender.
 javax.mail.internet.InternetAddress getFrom()
          Returns the "From" header address.
 String getHtmlPart()
          Gets the HTML part (if it exists)
 String getTextPart()
          Gets the text/plain part of the message
 void setEngine(Jasen engine)
          Sets the current engine instance into which this wrapper was injected.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JasenMessageWrapper

public JasenMessageWrapper(JasenMessage source)
Method Detail

getTextPart

public String getTextPart()
                   throws JasenException
Description copied from interface: JasenMessage
Gets the text/plain part of the message

Specified by:
getTextPart in interface JasenMessage
Returns:
A String representation of the text/plain MIME part in the message
Throws:
JasenException

getHtmlPart

public String getHtmlPart()
                   throws JasenException
Description copied from interface: JasenMessage
Gets the HTML part (if it exists)

Specified by:
getHtmlPart in interface JasenMessage
Returns:
A String representation of the text/html MIME part in the message, or null if no such part exists
Throws:
JasenException

getAttachmentNames

public String[] getAttachmentNames()
                            throws JasenException
Description copied from interface: JasenMessage
Returns the names of all attachments in the message

Specified by:
getAttachmentNames in interface JasenMessage
Returns:
A String array containing only the filenames of any attachments found in the message, or null if there are none
Throws:
JasenException

getEnvelopeSender

public String getEnvelopeSender()
                         throws JasenException
Description copied from interface: JasenMessage

Returns the "envelope" sender. This means the "actual" sender of the message.

If this is not known, return the "From" address.

Specified by:
getEnvelopeSender in interface JasenMessage
Returns:
The email address of the envelope sender
Throws:
JasenException

getFrom

public javax.mail.internet.InternetAddress getFrom()
                                            throws JasenException
Description copied from interface: JasenMessage
Returns the "From" header address.
If this is not known, return the "From" address or "Reply-To" or "Return-Path"

Specified by:
getFrom in interface JasenMessage
Returns:
The contents of the From header
Throws:
JasenException

getEngine

public Jasen getEngine()
Gets the current engine instance into which this wrapper was injected.

Returns:
The current Jasen engine instance.

setEngine

public void setEngine(Jasen engine)
Sets the current engine instance into which this wrapper was injected.

Parameters:
engine - The current Jasen engine instance.