|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.util.DelimeterInserter
public class DelimeterInserter
This can take an input string and look into it for occurences of given terms. It will then intert delimeters into the input string arround the terms. You can use this to hilight text with bold tags in HTML for example.
This is smart enough to merge areas when they overlap or exit side by side, and only one set of delimeters will be inserted.
Constructor Summary | |
---|---|
DelimeterInserter(String frontDelimeter,
String endDelimeter)
Creates a DelimeterInserter that is in prefix mode and case insenstive. |
|
DelimeterInserter(String frontDelimeter,
String endDelimeter,
boolean prefixMode)
Creates a DelimeterInserter that is case insenstive. |
|
DelimeterInserter(String frontDelimeter,
String endDelimeter,
boolean prefixMode,
boolean caseInsensitive)
|
Method Summary | |
---|---|
String |
getConsideredWhitespace()
|
String |
insert(String targetString,
String[] terms)
Called to do the actual delimeter intertion |
void |
setConsideredWhitespace(String consideredWhitespace)
The String characters that can be considered whitespace ALONG with Character.iswhiteSpace(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DelimeterInserter(String frontDelimeter, String endDelimeter)
frontDelimeter
- the delimeter to use as around the front of a termendDelimeter
- the delimeter to use as around the end of a termpublic DelimeterInserter(String frontDelimeter, String endDelimeter, boolean prefixMode)
frontDelimeter
- the delimeter to use as around the front of a termendDelimeter
- the delimeter to use as around the end of a termprefixMode
- whether a match must be made on word boundariespublic DelimeterInserter(String frontDelimeter, String endDelimeter, boolean prefixMode, boolean caseInsensitive)
frontDelimeter
- the delimeter to use as around the front of a termendDelimeter
- the delimeter to use as around the end of a termprefixMode
- whether a match must be made on word boundariescaseInsensitive
- whether matching is case insenstiveMethod Detail |
---|
public String getConsideredWhitespace()
public void setConsideredWhitespace(String consideredWhitespace)
consideredWhitespace
- the extra whitespace characterspublic String insert(String targetString, String[] terms)
targetString
- the target string to insert the delimeters intoterms
- the terms to look for in the targetString
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |