com.atlassian.jira.util
Interface EmailFormatter

All Known Implementing Classes:
EmailFormatterImpl

public interface EmailFormatter

Returned email address appropriately masked/hidden for the current user.


Method Summary
 boolean emailVisible(com.atlassian.crowd.embedded.api.User user)
          Is Email visible.
 String formatEmail(String email, boolean isCurrentUserLoggedIn)
          Potentially hide/mask an email address.
 String formatEmail(String email, com.atlassian.crowd.embedded.api.User currentUser)
          Potentially hide/mask an email address.
 String formatEmail(com.atlassian.crowd.embedded.api.User user, com.atlassian.crowd.embedded.api.User currentUser)
          Formats how the user's Email address is to be displayed to the currentUser determined by the user email visibility value
 String formatEmailAsLink(String email, com.atlassian.crowd.embedded.api.User currentUser)
          Returns email address as HTML.
 

Method Detail

emailVisible

boolean emailVisible(com.atlassian.crowd.embedded.api.User user)
Is Email visible.

Parameters:
user -
Returns:
true if emnail should be visible
Since:
v4.3

formatEmail

String formatEmail(com.atlassian.crowd.embedded.api.User user,
                   com.atlassian.crowd.embedded.api.User currentUser)
Formats how the user's Email address is to be displayed to the currentUser determined by the user email visibility value

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
Since:
v4.3

formatEmail

String formatEmail(String email,
                   boolean isCurrentUserLoggedIn)
Potentially hide/mask an email address.

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

String formatEmail(String email,
                   @Nullable
                   com.atlassian.crowd.embedded.api.User currentUser)
Potentially hide/mask an email address.

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.
Since:
v4.3

formatEmailAsLink

String formatEmailAsLink(String email,
                         @Nullable
                         com.atlassian.crowd.embedded.api.User currentUser)
Returns email address as HTML.

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).
Since:
v4.3


Copyright © 2002-2012 Atlassian. All Rights Reserved.