org.shaker.dwu
Class BugzillaMail

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

final class BugzillaMail
extends BugMail

This subclass of MailBody delivers a Bugzilla mail bug sumission compatible 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 BugzillaMail(BugProfile bugProfile)
          Creates the MailBody.
 
Method Summary
protected  java.lang.String getMailBody()
          Returns the bug submission mail body.
protected  java.lang.String getMimeType()
          Returns text/plain.
protected  java.lang.String getSubjectLine()
          Returns an empty string.
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, if the BugProfile contains all required properties (must not be null or empty!).
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

BugzillaMail

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

isSatisfied

protected boolean isSatisfied()
Returns true, if the BugProfile contains all required properties (must not be null or empty!). These are:
Overrides:
isSatisfied in class BugMail
Returns:
true, if all necessary informations are available and valid

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 an empty string. You could put the short_desc into the subject line, but dwu saves it in the mail body.
Overrides:
getSubjectLine in class BugMail
Returns:
an empty string

getMailBody

protected java.lang.String getMailBody()
Returns the bug submission mail body.
Overrides:
getMailBody in class BugMail
Returns:
the bugmail formatted 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