public interface

MessageUtil

implements BaseUrl I18nHelper
com.atlassian.jira.message.MessageUtil
Known Indirect Subclasses

Class Overview

A message utility that acts as a delegate to to the following utilities:

I18nHelper , HelpUrls, BaseUrl and ExternalLinkUtil.

This utility contains convenient methods to retrieve i18n messages, help urls and external urls.

Summary

Nested Classes
interface MessageUtil.Factory  
Public Methods
String getAnchorTagWithInternalLink(String keyOfLink)
Get a String representation of an anchor tag with an internal link and link text.
@Nonnull HelpUrl getDefaultUrl()
Returns a HelpUrl that can be used for generic JIRA help.
String getExternalLink(String key, String value1, String value2, String value3, String value4)
Get the external link for the specified key with the specified parameters formatted into the link.
String getExternalLink(String key)
Get the external link for the specified key.
String getExternalLink(String key, Object parameters)
Get the external link for the specified key with the specified parameters formatted into the link.
String getExternalLink(String key, String value1)
Get the external link for the specified key with the specified parameter formatted into the link.
String getExternalLink(String key, String value1, String value2)
Get the external link for the specified key with the specified parameters formatted into the link.
String getExternalLink(String key, String value1, String value2, String value3)
Get the external link for the specified key with the specified parameters formatted into the link.
@Nonnull HelpUrl getUrl(String key)
Returns a HelpUrl associated with the passed key.
@Nonnull Set<String> getUrlKeys()
Return all the keys that have an associated HelpUrl.
[Expand]
Inherited Methods
From interface com.atlassian.jira.util.BaseUrl
From interface com.atlassian.jira.util.I18nHelper

Public Methods

public String getAnchorTagWithInternalLink (String keyOfLink)

Get a String representation of an anchor tag with an internal link and link text. The internal link would be the JIRA base url with the path of the specified key appended.

Example for default implementation:

     #Config internal-help-paths.properties:
     app_access_local.path=/secure/admin/ApplicationAccess.jspa
     app_access_local.title=application.access.configuration.title

     #Config JiraWebActionSupport.properties:
     application.access.configuration.title=Application Access

     #Usage:
     messageUtil.getAnchorTagWithInternalLink("app_access_local");

     #Result:
     Application access
 

Parameters
keyOfLink the key for the internal link to be appended with the base URL.
Returns
  • a String representation of an anchor tag with an internal link and link text.
See Also

@Nonnull public HelpUrl getDefaultUrl ()

Returns a HelpUrl that can be used for generic JIRA help. It commonly points at the JIRA help index/landing page.

Returns
  • the default HelpUrl for this instance.
See Also

public String getExternalLink (String key, String value1, String value2, String value3, String value4)

Get the external link for the specified key with the specified parameters formatted into the link.

Parameters
key of the external link.
value1 first specified parameter.
value2 second specified parameter.
value3 third specified parameter.
value4 third specified parameter.
Returns
  • the external link with the parameters formatted into the link or the specified key if the link was not found.

public String getExternalLink (String key)

Get the external link for the specified key.

Parameters
key of the external link.
Returns
  • the external link or the specified key if the link was not found.

public String getExternalLink (String key, Object parameters)

Get the external link for the specified key with the specified parameters formatted into the link.

Parameters
key of the external link.
parameters specified parameters, typically a List of parameters.
Returns
  • the external link with the parameters formatted into the link or the specified key if the link was not found.

public String getExternalLink (String key, String value1)

Get the external link for the specified key with the specified parameter formatted into the link.

Parameters
key of the external link.
value1 specified parameter.
Returns
  • the external link with the parameter formatted into the link or the specified key if the link was not found.

public String getExternalLink (String key, String value1, String value2)

Get the external link for the specified key with the specified parameters formatted into the link.

Parameters
key of the external link.
value1 first specified parameter.
value2 second specified parameter.
Returns
  • the external link with the parameters formatted into the link or the specified key if the link was not found.

public String getExternalLink (String key, String value1, String value2, String value3)

Get the external link for the specified key with the specified parameters formatted into the link.

Parameters
key of the external link.
value1 first specified parameter.
value2 second specified parameter.
value3 third specified parameter.
Returns
  • the external link with the parameters formatted into the link or the specified key if the link was not found.

@Nonnull public HelpUrl getUrl (String key)

Returns a HelpUrl associated with the passed key. The getDefaultUrl() URL is returned if the key has no associated URL.

Parameters
key the key to search for.
Returns
  • the HelpUrl
See Also

@Nonnull public Set<String> getUrlKeys ()

Return all the keys that have an associated HelpUrl.

Returns
  • all the keys that have an associated HelpUrl.
See Also