org.shaker.dwu
Class PlainTextMail

java.lang.Object
  |
  +--org.shaker.dwu.BugMail
        |
        +--org.shaker.dwu.PlainTextMail

final class PlainTextMail
extends BugMail

This subclass of MailBody delivers a well formatted and low-sized mail body (about 1KB).

Author:
Philipp Bartsch (codeshaker@gmx.net), GPL License

Field Summary
private  BugProfile bug
          The corresponding BugProfile
 
Fields inherited from class org.shaker.dwu.BugMail
DATE, ERROR_CLASS, MAIL_TO, MESSAGE, NEW_LINE, P_NAME, P_VERSION, SEND_FORMAT, STACK_TRACE, USER_COMMENT
 
Constructor Summary
protected PlainTextMail(BugProfile bugProfile)
          Creates the MailBody.
 
Method Summary
protected  java.lang.String getMailBody()
          Exports the given PropertySet (a BugProfile) into a plain text (without eye candy), that gets embedded into a mail body.
protected  java.lang.String getMimeType()
          Returns text/plain.
protected  java.lang.String getSubjectLine()
          Returns "DWU $message $bugprofile-hashsig"
private static java.lang.String getTextRow(java.lang.String key, java.lang.String value)
          Returns a formatted textrow for a key-value pair
protected  boolean isSatisfied()
          Returns true.
private static java.lang.String wellform(java.lang.String text)
          Returns the given text with replaced linebreaks.
 
Methods inherited from class org.shaker.dwu.BugMail
isStandardKey, replace_impl
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

bug

private final BugProfile bug
The corresponding BugProfile
Constructor Detail

PlainTextMail

protected PlainTextMail(BugProfile bugProfile)
Creates the MailBody.
Parameters:
bugProfile - the calling BugProfile that gets exported.
Method Detail

isSatisfied

protected boolean isSatisfied()
Returns true.
Overrides:
isSatisfied in class BugMail
Returns:
always true; this format has no requirements

getMimeType

protected final java.lang.String getMimeType()
Returns text/plain.
Overrides:
getMimeType in class BugMail
Returns:
MIME type text/plain

getSubjectLine

protected final java.lang.String getSubjectLine()
Returns "DWU $message $bugprofile-hashsig"
Overrides:
getSubjectLine in class BugMail
Returns:
the subject line

getMailBody

protected final java.lang.String getMailBody()
Exports the given PropertySet (a BugProfile) into a plain text (without eye candy), that gets embedded into a mail body.
Overrides:
getMailBody in class BugMail
Returns:
the plain text mail body

getTextRow

private static final java.lang.String getTextRow(java.lang.String key,
                                                 java.lang.String value)
Returns a formatted textrow for a key-value pair
Parameters:
key - the label
value - the content
Returns:
the formatted textrow

wellform

private static java.lang.String wellform(java.lang.String text)
Returns the given text with replaced linebreaks.
Parameters:
text - the text to be wellformed
Returns:
the wellformed text