Interface MessageUtil

All Superinterfaces:
BaseUrl, I18nHelper
All Known Implementing Classes:
MessageUtilImpl

public interface MessageUtil extends I18nHelper, BaseUrl
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.

Since:
7.0
  • Method Details

    • getUrl

      @Nonnull 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:
    • getDefaultUrl

      @Nonnull 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:
    • getUrlKeys

      @Nonnull Set<String> getUrlKeys()
      Return all the keys that have an associated HelpUrl.
      Returns:
      all the keys that have an associated HelpUrl.
      See Also:
    • getExternalLink

      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.
      See Also:
    • getExternalLink

      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.
      See Also:
    • getExternalLink

      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.
      See Also:
    • getExternalLink

      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.
      See Also:
    • getExternalLink

      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.
      See Also:
    • getExternalLink

      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.
      See Also:
    • getAnchorTagWithInternalLink

      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: