public interface IssueFinder
Note that an implementation of this interface is not mandatory for a NetBeans bugtracking plugin.
Modifier and Type | Method and Description |
---|---|
String |
getIssueId(String issueHyperlinkText)
Transforms the given text to an issue identifier.
|
int[] |
getIssueSpans(CharSequence text)
Finds boundaries of one or more references to issues in the given text.
|
int[] getIssueSpans(CharSequence text)
null
and must contain even number
of numbers. An empty array is a valid return value. The first number in
the array is an index of the beginning of a reference string,
the second number is an index of the first character after the reference
string. Next numbers express boundaries of other found references, if
any.
The reference substrings (given by indexes returned by this method)
may contain any text as long as method IssueFinder.getIssueId(java.lang.String)
is able to
extract issue identifiers from them. E.g. it is correct that method
getIssueSpans()
, when given text "fixed the first bug",
returns array [6, 19]
(boundaries of substring
"the first bug"
) if method IssueFinder.getIssueId(java.lang.String)
can
deduce that substring "the first bug"
refers to bug
#1. In other words, only (boundaries of) substrings that method
IssueFinder.getIssueId(java.lang.String)
is able to transform the actual issue identifier,
should be returned by this method.
Please note that this method might be called in EDT and should avoid any excessive computation.
text
- text to be searched for referencesnull
array of boundaries of hyperlink references
in the given textString getIssueId(String issueHyperlinkText)
Please note that this method might be called in EDT and should avoid any excessive computation.
issueHyperlinkText
- text that refers to a bug/issue