Class MailToLinkTextFilter

  • All Implemented Interfaces:
    com.opensymphony.module.sitemesh.html.TextFilter

    public class MailToLinkTextFilter
    extends Object
    implements com.opensymphony.module.sitemesh.html.TextFilter
    A text filter to inject a mailto: URL.

    It provides the following syntax:

     %{MAIL:id|link text[|subject text[|body text]]}%
     

    where id is either an email address or an identifier in the map provided with the constructor that should map to an email address, text is the text of the link, subject is the subject of the email and body is the body of the email. The subject and body parameters are optional, but both values will be encoded according RFC 3987.

    It will be converted into:

     <a href="mailto:email@id.moon?subject=subject%20text&body=body%20text">link text</a>
     
    Since:
    1.3
    Author:
    Jörg Schaible
    • Constructor Detail

      • MailToLinkTextFilter

        public MailToLinkTextFilter​(Map<String,​String> mailMap)
      • MailToLinkTextFilter

        public MailToLinkTextFilter​(Map<String,​String> mailMap,
                                    String classAttribute)
    • Method Detail

      • filter

        public String filter​(String text)
        Specified by:
        filter in interface com.opensymphony.module.sitemesh.html.TextFilter