Class MessageComposer


  • public class MessageComposer
    extends java.lang.Object
    The Class MessageComposer.
    • Constructor Summary

      Constructors 
      Constructor Description
      MessageComposer()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static MessageContent createMessageModel​(java.util.Map<java.lang.String,​java.lang.Object> contextModel, java.lang.String xmlMailTemplateName, java.util.Locale locale)
      Creates the message model.
      static MessageContent getEmailTemplate​(java.lang.String name)
      Gets the email template as a BaseMessage Model that contains the velocity templates.
      static java.lang.String getXmlMailTemplateName​(java.lang.String xmlMailTemplateName, java.util.Locale locale, boolean withCountry)
      Gets the xml mail template name from the given String and Locale.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MessageComposer

        public MessageComposer()
    • Method Detail

      • createMessageModel

        public static MessageContent createMessageModel​(java.util.Map<java.lang.String,​java.lang.Object> contextModel,
                                                        java.lang.String xmlMailTemplateName,
                                                        java.util.Locale locale)
                                                 throws java.io.IOException,
                                                        org.apache.velocity.runtime.parser.ParseException,
                                                        java.net.URISyntaxException
        Creates the message model.
        Parameters:
        contextModel - the velocity context model
        xmlMailTemplateName - the xml mail template name
        locale - the locale
        Returns:
        the message model
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
        org.apache.velocity.runtime.parser.ParseException - the parse exception
        java.net.URISyntaxException - the URI syntax exception
      • getEmailTemplate

        public static MessageContent getEmailTemplate​(java.lang.String name)
                                               throws java.io.IOException
        Gets the email template as a BaseMessage Model that contains the velocity templates.
        Parameters:
        name - The resource name that represents an IMessageModel as an xml file.
        Returns:
        the email template
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • getXmlMailTemplateName

        public static java.lang.String getXmlMailTemplateName​(java.lang.String xmlMailTemplateName,
                                                              java.util.Locale locale,
                                                              boolean withCountry)
        Gets the xml mail template name from the given String and Locale.
        Parameters:
        xmlMailTemplateName - the xml mail template name
        locale - the locale
        withCountry - the with country
        Returns:
        the xml mail template name