Package org.eclipse.equinox.bidi
Class StructuredTextProcessor
- java.lang.Object
-
- org.eclipse.equinox.bidi.StructuredTextProcessor
-
public final class StructuredTextProcessor extends Object
Provides methods to process bidirectional text with a specific structure. The methods in this class are the most straightforward way to add directional formatting characters to the source text to ensure correct presentation, or to remove those characters to restore the original text (for more explanations, please see thepackage documentation
.This class can be used without OSGi running (but only the structured text types declared in
StructuredTextTypeHandlerFactory
are available in that mode).- Restriction:
- This class is not intended to be instantiated by clients.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
deprocess(String str)
Removes directional formatting characters in the given string.static String
deprocessTyped(String str, String textType)
Removes directional formatting characters in the given string.static String
getDefaultSeparators()
Returns a string containing all the default separator characters to be used to segment a given string.static String
process(String str)
Processes the given (lean) text and returns a string with appropriate directional formatting characters (full text).static String
process(String str, String separators)
Processes a string that has a particular semantic meaning to render it correctly in bidi environments.static String
processTyped(String str, String textType)
Processes a string that has a particular semantic meaning to render it correctly in bidi environments.
-
-
-
Method Detail
-
process
public static String process(String str)
Processes the given (lean) text and returns a string with appropriate directional formatting characters (full text). This is equivalent to callingprocess(String str, String separators)
with the default set of separators.The processing adds directional formatting characters so that presentation using the Unicode Bidirectional Algorithm will provide the expected result. The text is segmented according to the provided separators. Each segment has the Unicode Bidi Algorithm applied to it, but as a whole, the string is oriented left to right.
For example, a file path such as
d:\myfolder\FOLDER\MYFILE.java
(where capital letters indicate RTL text) should render asd:\myfolder\REDLOF\ELIFYM.java
.- Parameters:
str
- the lean text to process- Returns:
- the processed string (full text)
- See Also:
deprocess(String)
-
process
public static String process(String str, String separators)
Processes a string that has a particular semantic meaning to render it correctly in bidi environments. For more details, seeprocess(String)
.- Parameters:
str
- the lean text to processseparators
- characters by which the string will be segmented- Returns:
- the processed string (full text)
- See Also:
deprocess(String)
-
processTyped
public static String processTyped(String str, String textType)
Processes a string that has a particular semantic meaning to render it correctly in bidi environments. For more details, seeprocess(String)
.- Parameters:
str
- the lean text to process.textType
- an identifier for the structured text handler appropriate for the type of the text submitted. It may be one of the identifiers defined inStructuredTextTypeHandlerFactory
or a type handler identifier registered by a plug-in.- Returns:
- the processed string (full text).
- See Also:
deprocessTyped(java.lang.String, java.lang.String)
-
deprocess
public static String deprocess(String str)
Removes directional formatting characters in the given string.- Parameters:
str
- string with directional characters to remove (full text).- Returns:
- string without directional formatting characters (lean text).
-
deprocessTyped
public static String deprocessTyped(String str, String textType)
Removes directional formatting characters in the given string.- Parameters:
str
- string with directional characters to remove (full text).textType
- an identifier for the structured text handler appropriate for the type of the text submitted. It may be one of the identifiers defined inStructuredTextTypeHandlerFactory
or a type handler identifier registered by a plug-in.- Returns:
- string without directional formatting characters (lean text).
- See Also:
processTyped(String, String)
-
getDefaultSeparators
public static String getDefaultSeparators()
Returns a string containing all the default separator characters to be used to segment a given string.- Returns:
- string containing all separators.
-
-