com.atlassian.jira.i18n
Class AbstractI18nResolver

java.lang.Object
  extended by com.atlassian.jira.i18n.AbstractI18nResolver
All Implemented Interfaces:
com.atlassian.sal.api.message.I18nResolver
Direct Known Subclasses:
JiraI18nResolver

public abstract class AbstractI18nResolver
extends Object
implements com.atlassian.sal.api.message.I18nResolver

Copied from sal-core.

IMPORTANT! JRA-25571 Do not add dependency on sal-core to jira-core: this causes Bugs due to ClassLoader issues. Note: to be removed once SAL-214 is fixed.

Since:
v5.0

Constructor Summary
AbstractI18nResolver()
           
 
Method Summary
 com.atlassian.sal.api.message.Message createMessage(String key, Serializable... arguments)
           
 com.atlassian.sal.api.message.MessageCollection createMessageCollection()
           
 String getText(Locale locale, com.atlassian.sal.api.message.Message message)
           
 String getText(Locale locale, String key)
           
 String getText(Locale locale, String key, Serializable... arguments)
           
 String getText(com.atlassian.sal.api.message.Message message)
           
 String getText(String key)
           
 String getText(String key, Serializable... arguments)
           
abstract  String resolveText(Locale locale, String key, Serializable[] arguments)
          Subclasses should implement this method to dispatch to a matching language in the given locale.
abstract  String resolveText(String key, Serializable[] arguments)
          Subclasses should implement this method to dispatch to a matching language in (in order of preference): the user's locale the application's configured locale, or the system default locale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.sal.api.message.I18nResolver
getAllTranslationsForPrefix, getAllTranslationsForPrefix, getRawText
 

Constructor Detail

AbstractI18nResolver

public AbstractI18nResolver()
Method Detail

getText

public String getText(String key,
                      Serializable... arguments)
Specified by:
getText in interface com.atlassian.sal.api.message.I18nResolver

getText

public String getText(Locale locale,
                      String key,
                      Serializable... arguments)
Specified by:
getText in interface com.atlassian.sal.api.message.I18nResolver

getText

public String getText(String key)
Specified by:
getText in interface com.atlassian.sal.api.message.I18nResolver

getText

public String getText(Locale locale,
                      String key)
Specified by:
getText in interface com.atlassian.sal.api.message.I18nResolver

getText

public String getText(com.atlassian.sal.api.message.Message message)
Specified by:
getText in interface com.atlassian.sal.api.message.I18nResolver

getText

public String getText(Locale locale,
                      com.atlassian.sal.api.message.Message message)
Specified by:
getText in interface com.atlassian.sal.api.message.I18nResolver

resolveText

public abstract String resolveText(String key,
                                   Serializable[] arguments)
Subclasses should implement this method to dispatch to a matching language in (in order of preference):

Parameters:
key - the key to translate.
arguments - the arguments to be inserted into the translated string.
Returns:
the translated string.

resolveText

public abstract String resolveText(Locale locale,
                                   String key,
                                   Serializable[] arguments)
Subclasses should implement this method to dispatch to a matching language in the given locale.

Parameters:
locale - the locale to translate into.
key - the key to translate.
arguments - the arguments to be inserted into the translated string.
Returns:
the translated string.

createMessage

public com.atlassian.sal.api.message.Message createMessage(String key,
                                                           Serializable... arguments)
Specified by:
createMessage in interface com.atlassian.sal.api.message.I18nResolver

createMessageCollection

public com.atlassian.sal.api.message.MessageCollection createMessageCollection()
Specified by:
createMessageCollection in interface com.atlassian.sal.api.message.I18nResolver


Copyright © 2002-2013 Atlassian. All Rights Reserved.