com.atlassian.jira.plugin.profile
Class DefaultUserFormatManager

java.lang.Object
  extended by com.atlassian.jira.plugin.profile.DefaultUserFormatManager
All Implemented Interfaces:
UserFormatManager

public class DefaultUserFormatManager
extends Object
implements UserFormatManager

Default implementation: Stores the default user format module descriptor plugin module in an application property.

Since:
v3.13

Field Summary
static String PS_KEY
           
 
Constructor Summary
DefaultUserFormatManager(JiraPropertySetFactory jiraPropertySetFactory, UserFormatMapper userFormatMapper)
           
 
Method Summary
 String formatUser(String username, String type, String id)
          Convenience method to format a given user.
 String formatUser(String username, String type, String id, Map params)
          Convenience method to format a given user.
 UserFormat getUserFormat(String type)
          Returns the UserFormat for a specific type, or null if none exists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PS_KEY

public static final String PS_KEY
See Also:
Constant Field Values
Constructor Detail

DefaultUserFormatManager

public DefaultUserFormatManager(JiraPropertySetFactory jiraPropertySetFactory,
                                UserFormatMapper userFormatMapper)
Method Detail

formatUser

public String formatUser(String username,
                         String type,
                         String id)
Description copied from interface: UserFormatManager
Convenience method to format a given user. Method looks up the mapped user format for the type and passes the username and id to this user format. Returns null if no mapped user format can be found.

Specified by:
formatUser in interface UserFormatManager
Parameters:
username - The user to format
type - The user format type to use
id - A context sensitive id
Returns:
formatted user or null.

formatUser

public String formatUser(String username,
                         String type,
                         String id,
                         Map params)
Description copied from interface: UserFormatManager
Convenience method to format a given user. The params user allows a user to pass any information needed for additional context to the underlying UserFormat.

Specified by:
formatUser in interface UserFormatManager
Parameters:
username - The user to format
type - The user format type to use
id - A context sensitive id
params - Additional context to provide to the userformatter.
Returns:
formatted user or null.

getUserFormat

public UserFormat getUserFormat(String type)
Description copied from interface: UserFormatManager
Returns the UserFormat for a specific type, or null if none exists

Specified by:
getUserFormat in interface UserFormatManager
Parameters:
type - the specific type for which to find a UserFormat.
Returns:
the UserFormat for a specific type, or null if none exists


Copyright © 2002-2009 Atlassian. All Rights Reserved.