|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.osgi.util.TextProcessor
public class TextProcessor
This class is used to process strings that have special semantic meaning (such as file paths) in RTL-oriented locales so that they render in a way that does not corrupt the semantic meaning of the string but also maintains compliance with the Unicode BiDi algorithm of rendering Bidirectional text.
Processing of the string is done by breaking it down into segments that are specified by a set of user provided delimiters. Directional punctuation characters are injected into the string in order to ensure the string retains its semantic meaning and conforms with the Unicode BiDi algorithm within each segment.
Method Summary | |
---|---|
static java.lang.String |
deprocess(java.lang.String str)
Removes directional marker characters in the given string that were inserted by utilizing the process(String) or process(String, String)
methods. |
static java.lang.String |
getDefaultDelimiters()
Return the string containing all the default delimiter characters to be used to segment a given string. |
static java.lang.String |
process(java.lang.String text)
Process the given text and return a string with the appropriate substitution based on the locale. |
static java.lang.String |
process(java.lang.String str,
java.lang.String delimiter)
Process a string that has a particular semantic meaning to render on BiDi locales in way that maintains the semantic meaning of the text, but differs from the Unicode BiDi algorithm. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String process(java.lang.String text)
process(String, String)
with the default set of
delimiters.
text
- the text to be processed
process(String, String)
,
getDefaultDelimiters()
public static java.lang.String process(java.lang.String str, java.lang.String delimiter)
For example a file path such as d:\myFolder\FOLDER\MYFILE.java (where capital letters indicate RTL text) should render as d:\myFolder\REDLOF\ELIFYM.java when using the Unicode BiDi algorithm and segmenting the string according to the specified delimiter set.
The following algorithm is used:
NOTE: this method will change the shape of the original string passed in
by inserting punctuation characters into the text in order to make it
render to correctly reflect the semantic meaning of the text. Methods
like String.equals(String)
and
String.length()
called on the resulting string will not
return the same values as would be returned for the original string.
str
- the text to process, if null
return the string
as it was passed indelimiter
- delimiters by which the string will be segmented, if
null
the default delimiters are used
public static java.lang.String deprocess(java.lang.String str)
process(String)
or process(String, String)
methods.
str
- string with directional markers to remove
process(String)
,
process(String, String)
public static java.lang.String getDefaultDelimiters()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |