public class FormattingUtils
extends java.lang.Object
The methods in this class can be used to obtain strings that have been processed for i18n content to be presented in different ways, for example using CSS styling or unicode control characters
The getFormattedXYZ methods generate i18n strings using CSS bidi properties for use in display. This involves inserting HTML <span> tags containing CSS styling properties for text direction
The getEncodedXYZ methods generate unicode Strings using unicode control characters, and remove any embedded <span> tags
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
END |
static java.lang.String |
LRO |
static java.lang.String |
LTR |
static java.lang.String |
RLO |
static java.lang.String |
RTL |
| Constructor and Description |
|---|
FormattingUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getEncoded(java.lang.String dir,
java.lang.String value) |
protected static java.lang.String |
getFormatted(java.lang.String value)
Generates a CSS i18n string from a raw string.
|
protected static java.lang.String |
getFormatted(java.lang.String dir,
java.lang.String value)
Generates a CSS i18n string using a given direction and value
|
static java.lang.String |
getFormattedWidgetAuthor(IAuthor author)
Returns the CSS formatted i18n string for the widget author's name
|
static java.lang.String |
getFormattedWidgetDescription(IDescription description)
Returns the CSS formatted i18n string for the widget description
|
static java.lang.String |
getFormattedWidgetLicense(ILicense license)
Returns the CSS formatted i18n string for the widget license
|
static java.lang.String |
getFormattedWidgetName(IName name)
Returns the CSS formatted i18n string for the widget name
|
static java.lang.String |
getFormattedWidgetShortName(IName name)
Returns the CSS formatted i18n string for the widget short name
|
static java.lang.String |
getFormattedWidgetVersion(W3CWidget widget)
Returns the CSS formatted i18n string for the widget version
|
public static final java.lang.String LTR
public static final java.lang.String RTL
public static final java.lang.String LRO
public static final java.lang.String RLO
public static final java.lang.String END
public static java.lang.String getFormattedWidgetName(IName name)
name - the Widget's Name entitypublic static java.lang.String getFormattedWidgetShortName(IName name)
name - the Widget's Name entitypublic static java.lang.String getFormattedWidgetVersion(W3CWidget widget)
widget - the Widgetpublic static java.lang.String getFormattedWidgetDescription(IDescription description)
description - the Widget's description entitypublic static java.lang.String getFormattedWidgetAuthor(IAuthor author)
author - the Widget's author entitypublic static java.lang.String getFormattedWidgetLicense(ILicense license)
license - the Widget's License entityprotected static java.lang.String getFormatted(java.lang.String value)
value - protected static java.lang.String getFormatted(java.lang.String dir,
java.lang.String value)
dir - the text directionvalue - the value to modifypublic static java.lang.String getEncoded(java.lang.String dir,
java.lang.String value)
2012 Apache Software Foundation.