Package overit.geocall.mail
Class Body
java.lang.Object
overit.geocall.mail.Body
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeContentMode(int contentMode) Change the content modeReturns a copy of the BodyintReturns the content modegetHtml()Returns the htmlprotected static StringgetHtmlFromText(String text) Returns the html from a textgetProcessTag(String key) Gets the value of the process taggetProcessTag(String key, String def) Returns the value of the process tag, if it does not exist return default valueReturns an HashMap of process tagsgetText()Returns the textprotected static StringgetTextFromHtml(String html) Returns the text from an htmlbooleantrueif there is an html part,falseotherwisebooleanhaveProcessTag(String key) Returnstrueif the key is in the process tags,falseotherwisebooleanReturnstrueif there is a text part,falseotherwisevoidDeprecated.voidDeprecated.voidSets the htmlvoidsetProcessTag(String key, boolean have) Sets the process tagvoidsetProcessTag(String key, String value) Sets the process tagvoidSets the text
-
Field Details
-
CONTENTMODE_TEXT
public static final int CONTENTMODE_TEXT- See Also:
-
CONTENTMODE_HTML
public static final int CONTENTMODE_HTML- See Also:
-
CONTENTMODE_HTML_TEXT
public static final int CONTENTMODE_HTML_TEXT- See Also:
-
CONTENTMODE_HTML_AUTOTEXT
public static final int CONTENTMODE_HTML_AUTOTEXT- See Also:
-
_html
-
_text
-
_contentMode
protected int _contentMode -
_processTags
-
-
Constructor Details
-
Body
public Body(int contentMode) Constructor for Body- Parameters:
contentMode- The content mode (0:TEXT, 1:HTML, 2:HTML_TEXT, 3:HTML_AUTOTEXT)
-
Body
Contructor for Body- Parameters:
text- The texthtml- The htmlcontentMode- The content mode (0:TEXT, 1:HTML, 2:HTML_TEXT, 3:HTML_AUTOTEXT)
-
Body
Constructor for Body- Parameters:
text- The texthtml- The html
-
-
Method Details
-
getTextFromHtml
Returns the text from an html- Parameters:
html- The html string- Returns:
- The text from an html
-
getHtmlFromText
Returns the html from a text- Parameters:
text- The text string- Returns:
- The string containing the html from a text
-
changeContentMode
public void changeContentMode(int contentMode) Change the content mode- Parameters:
contentMode- The content mode (0:TEXT, 1:HTML, 2:HTML_TEXT, 3:HTML_AUTOTEXT)
-
getContentMode
public int getContentMode()Returns the content mode- Returns:
- The content mode (0:TEXT, 1:HTML, 2:HTML_TEXT, 3:HTML_AUTOTEXT)
-
setText
Sets the text- Parameters:
text- The text
-
setHtml
Sets the html- Parameters:
html- The html
-
getHtml
Returns the html- Returns:
- The html
-
getText
Returns the text- Returns:
- The text
-
newText
Deprecated.- Parameters:
text- String containing the text
-
newHtml
Deprecated.- Parameters:
html- String containing the html
-
haveTextPart
public boolean haveTextPart()Returnstrueif there is a text part,falseotherwise- Returns:
trueif there is a text part,falseotherwise
-
haveHtmlPart
public boolean haveHtmlPart()trueif there is an html part,falseotherwise- Returns:
trueif there is an html part,falseotherwise
-
getProcessTags
Returns an HashMap of process tags- Returns:
- An HashMap of process tags
-
setProcessTag
Sets the process tag- Parameters:
key- The keyvalue- The value
-
getProcessTag
Gets the value of the process tag- Parameters:
key- The key to find- Returns:
- The value of the process tag
-
getProcessTag
Returns the value of the process tag, if it does not exist return default value- Parameters:
key- The key to finddef- Defalut value- Returns:
- The value of the process tag, if it does not exist return default value
-
setProcessTag
Sets the process tag- Parameters:
key- The keyhave- Boolean value that if true put the key in the process tags, otherwise if its false it removes it from processtag
-
haveProcessTag
Returnstrueif the key is in the process tags,falseotherwise- Parameters:
key- The key to check- Returns:
trueif the key is in the process tags,falseotherwise
-
createCopy
Returns a copy of the Body- Returns:
- A copy of the Body
-