jetbrains.buildServer.issueTracker
Interface CommentTransformationHelper


public interface CommentTransformationHelper

Represents the class intended to provide all information needed for comment transformation.

Example: Let's consider the comment "blah-blah-blah #1234", where "#1234" is the issue id. When shown in UI, this substring is replaced with a link to a corresponding issue and a popup; and in order to construct such a replacement, server needs to know:

This data should be provided by the instance of this class.

Note: each CommentTransformationHelper corresponds to a single issue provider.

Since:
5.0
Author:
Maxim Podkolzine (maxim.podkolzine@jetbrains.com)

Method Summary
 java.lang.String composeUrl(java.lang.String id)
          Returns the URL corresponding to the matched id.
 java.lang.String extractId(java.lang.String match)
          Returns the issue id by the matched substring.
 java.util.regex.Pattern getSearchPattern()
          Returns the search pattern of issue id.
 

Method Detail

getSearchPattern

@NotNull
java.util.regex.Pattern getSearchPattern()
Returns the search pattern of issue id.

Returns:
search pattern

extractId

@NotNull
java.lang.String extractId(@NotNull
                                   java.lang.String match)
Returns the issue id by the matched substring.

Method is useful, if the issue id doesn't equal to the match (e.g. the match is "#1234", while actual issue id is just "1234").

Parameters:
match - the matched substring
Returns:
issue id

composeUrl

@NotNull
java.lang.String composeUrl(@NotNull
                                    java.lang.String id)
Returns the URL corresponding to the matched id.

Parameters:
id - matched id
Returns:
issue URL