com.atlassian.jira.plugin.profile
Class DefaultUserFormatManager

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

public class DefaultUserFormatManager
extends java.lang.Object
implements UserFormatManager, Startable

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

Since:
v3.13

Field Summary
static java.lang.String PS_KEY
           
 
Constructor Summary
DefaultUserFormatManager(JiraPropertySetFactory jiraPropertySetFactory, UserFormatMapper userFormatMapper, com.atlassian.event.api.EventPublisher eventPublisher)
           
 
Method Summary
 java.lang.String formatUser(java.lang.String username, java.lang.String type, java.lang.String id)
          Convenience method to format a given user.
 java.lang.String formatUser(java.lang.String username, java.lang.String type, java.lang.String id, java.util.Map params)
          Convenience method to format a given user.
 UserFormat getUserFormat(java.lang.String type)
          Returns the UserFormat for a specific type, or null if none exists
 void onClearCache(ClearCacheEvent event)
           
 void start()
          This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.
 
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 java.lang.String PS_KEY
See Also:
Constant Field Values
Constructor Detail

DefaultUserFormatManager

public DefaultUserFormatManager(JiraPropertySetFactory jiraPropertySetFactory,
                                UserFormatMapper userFormatMapper,
                                com.atlassian.event.api.EventPublisher eventPublisher)
Method Detail

start

public void start()
           throws java.lang.Exception
Description copied from interface: Startable
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.

Specified by:
start in interface Startable
Throws:
java.lang.Exception - Allows implementations to throw an Exception.

onClearCache

@EventListener
public void onClearCache(ClearCacheEvent event)

formatUser

public java.lang.String formatUser(java.lang.String username,
                                   java.lang.String type,
                                   java.lang.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 java.lang.String formatUser(java.lang.String username,
                                   java.lang.String type,
                                   java.lang.String id,
                                   java.util.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(java.lang.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-2010 Atlassian. All Rights Reserved.