Class Body

java.lang.Object
overit.geocall.mail.Body
All Implemented Interfaces:
Serializable

public class Body extends Object implements Serializable
See Also:
  • 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

      protected String _html
    • _text

      protected String _text
    • _contentMode

      protected int _contentMode
    • _processTags

      protected HashMap _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

      public Body(String text, String html, int contentMode)
      Contructor for Body
      Parameters:
      text - The text
      html - The html
      contentMode - The content mode (0:TEXT, 1:HTML, 2:HTML_TEXT, 3:HTML_AUTOTEXT)
    • Body

      public Body(String text, String html)
      Constructor for Body
      Parameters:
      text - The text
      html - The html
  • Method Details

    • getTextFromHtml

      protected static String getTextFromHtml(String html)
      Returns the text from an html
      Parameters:
      html - The html string
      Returns:
      The text from an html
    • getHtmlFromText

      protected static String getHtmlFromText(String text)
      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

      public void setText(String text)
      Sets the text
      Parameters:
      text - The text
    • setHtml

      public void setHtml(String html)
      Sets the html
      Parameters:
      html - The html
    • getHtml

      public String getHtml()
      Returns the html
      Returns:
      The html
    • getText

      public String getText()
      Returns the text
      Returns:
      The text
    • newText

      public void newText(String text)
      Deprecated.
      Parameters:
      text - String containing the text
    • newHtml

      public void newHtml(String html)
      Deprecated.
      Parameters:
      html - String containing the html
    • haveTextPart

      public boolean haveTextPart()
      Returns true if there is a text part, false otherwise
      Returns:
      true if there is a text part, false otherwise
    • haveHtmlPart

      public boolean haveHtmlPart()
      true if there is an html part, false otherwise
      Returns:
      true if there is an html part, false otherwise
    • getProcessTags

      public HashMap getProcessTags()
      Returns an HashMap of process tags
      Returns:
      An HashMap of process tags
    • setProcessTag

      public void setProcessTag(String key, String value)
      Sets the process tag
      Parameters:
      key - The key
      value - The value
    • getProcessTag

      public String getProcessTag(String key)
      Gets the value of the process tag
      Parameters:
      key - The key to find
      Returns:
      The value of the process tag
    • getProcessTag

      public String getProcessTag(String key, String def)
      Returns the value of the process tag, if it does not exist return default value
      Parameters:
      key - The key to find
      def - Defalut value
      Returns:
      The value of the process tag, if it does not exist return default value
    • setProcessTag

      public void setProcessTag(String key, boolean have)
      Sets the process tag
      Parameters:
      key - The key
      have - Boolean value that if true put the key in the process tags, otherwise if its false it removes it from processtag
    • haveProcessTag

      public boolean haveProcessTag(String key)
      Returns true if the key is in the process tags, false otherwise
      Parameters:
      key - The key to check
      Returns:
      true if the key is in the process tags, false otherwise
    • createCopy

      public Body createCopy()
      Returns a copy of the Body
      Returns:
      A copy of the Body