com.atlassian.jira.util
Class EmailFormatterImpl

java.lang.Object
  extended by com.atlassian.jira.util.EmailFormatterImpl
All Implemented Interfaces:
EmailFormatter

public class EmailFormatterImpl
extends java.lang.Object
implements EmailFormatter


Constructor Summary
EmailFormatterImpl(ApplicationProperties applicationProperties)
           
 
Method Summary
 boolean emailVisible(com.opensymphony.user.User user)
          Emails are visible by user if email visibility is set to show (public) or mask (masked) or user (show to logged in users only)
 java.lang.String formatEmail(java.lang.String email, boolean isCurrentUserLoggedIn)
          Potentially hide/mask an email address.
 java.lang.String formatEmail(java.lang.String email, com.opensymphony.user.User currentUser)
          Potentially hide/mask an email address.
 java.lang.String formatEmail(com.opensymphony.user.User user, com.opensymphony.user.User currentUser)
          Formats how the user's Email address is to be displayed to the currentUser determined by the user email visibility value
 java.lang.String formatEmailAsLink(java.lang.String email, com.opensymphony.user.User currentUser)
          Returns a HTML link for the e-mail if appropriate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmailFormatterImpl

public EmailFormatterImpl(ApplicationProperties applicationProperties)
Method Detail

emailVisible

public boolean emailVisible(com.opensymphony.user.User user)
Emails are visible by user if email visibility is set to show (public) or mask (masked) or user (show to logged in users only)

Specified by:
emailVisible in interface EmailFormatter

formatEmail

public java.lang.String formatEmail(com.opensymphony.user.User user,
                                    com.opensymphony.user.User currentUser)
Description copied from interface: EmailFormatter
Formats how the user's Email address is to be displayed to the currentUser determined by the user email visibility value

Specified by:
formatEmail in interface EmailFormatter
Parameters:
user - owner of the email address to format and display
currentUser - the current logged in user viewing the email address of the above user
Returns:
String - formatted email address, or null if currentUser is not allowed to view it

formatEmail

public java.lang.String formatEmail(java.lang.String email,
                                    boolean isCurrentUserLoggedIn)
Description copied from interface: EmailFormatter
Potentially hide/mask an email address.

Specified by:
formatEmail in interface EmailFormatter
Parameters:
email - The email address to show/mask/hide.
isCurrentUserLoggedIn - is the current user logged in or anonymous
Returns:
String - formatted email address, or null if currentUser is not allowed to view it

formatEmail

public java.lang.String formatEmail(java.lang.String email,
                                    com.opensymphony.user.User currentUser)
Description copied from interface: EmailFormatter
Potentially hide/mask an email address.

Specified by:
formatEmail in interface EmailFormatter
Parameters:
email - The email address to show/mask/hide.
currentUser - The user viewing the email address.
Returns:
The email address, possibly masked, or null if the user is not allowed to view it.

formatEmailAsLink

public java.lang.String formatEmailAsLink(java.lang.String email,
                                          com.opensymphony.user.User currentUser)
Returns a HTML link for the e-mail if appropriate. REMEMBER not to escape the string returned by this method as this method does this already!

Specified by:
formatEmailAsLink in interface EmailFormatter
Returns:
<a href="foo@bar.com">foo@bar.com</a> (public), <a href="foo at bar.com">foo at bar.com</a> (masked), or "" (hidden).


Copyright © 2002-2010 Atlassian. All Rights Reserved.