|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.birt.report.model.api.util.StringUtil
public class StringUtil
Collection of string utilities.
Field Summary | |
---|---|
static java.lang.String |
EMPTY_STRING
|
Constructor Summary | |
---|---|
StringUtil()
|
Method Summary | |
---|---|
static java.lang.String |
buildQualifiedReference(java.lang.String namespace,
java.lang.String value)
Builds the qualified reference value. |
static java.lang.String |
doubleToString(double d,
int fNumber)
Converts the double value to locale-independent string representation. |
static java.lang.String |
doubleToString(double d,
int fNumber,
com.ibm.icu.util.ULocale locale)
Converts the double value to locale-dependent string representation. |
static java.lang.String |
extractFileName(java.lang.String filePathName)
Extract file name (without path and suffix) from file name with path and suffix. |
static java.lang.String |
extractFileNameWithSuffix(java.lang.String filePathName)
Extract file name (without path but with suffix) from file name with path and suffix. |
static java.lang.String |
extractName(java.lang.String qualifiedName)
Extracts the name from the given qualified reference value. |
static java.lang.String |
extractNamespace(java.lang.String qualifiedName)
Extracts the libaray namespace from the given qualified reference value. |
static boolean |
isBlank(java.lang.String str)
Reports if a string is blank. |
static boolean |
isEmpty(java.lang.String value)
Reports if a string is empty. |
static boolean |
isEqual(java.lang.String str1,
java.lang.String str2)
Returns if the two string are null or equal. |
static boolean |
isEqualIgnoreCase(java.lang.String str1,
java.lang.String str2)
Returns if the two string are null or equal. |
static boolean |
isValidLocale(java.lang.String locale)
Check if the locale string is a valid locale format, with the language, country and variant separated by underbars. |
static DimensionValue |
parse(java.lang.String value)
Parses a dimension string in locale-independent way. |
static DimensionValue |
parseInput(java.lang.String value,
com.ibm.icu.util.ULocale locale)
Parses a dimension string in locale-dependent way. |
static java.lang.String |
toRgbText(int rgb)
Convert an integer to an HTML RGB value. |
static java.lang.String |
trimQuotes(java.lang.String value)
Trims the quotes. |
static java.lang.String |
trimString(java.lang.String value)
Trim a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String EMPTY_STRING
Constructor Detail |
---|
public StringUtil()
Method Detail |
---|
public static java.lang.String trimString(java.lang.String value)
value
- the string to trim
public static java.lang.String toRgbText(int rgb)
rgb
- the integer RGB value
public static boolean isValidLocale(java.lang.String locale)
The language argument is a valid ISO Language Code. . These codes are the lower-case, two-letter codes.
The country argument is a valid ISO Country Code. These codes are the upper-case, two-letter codes.
If the language is missing, the string should begin with an underbar. (Can't have a locale with just a variant -- the variant must accompany a valid language or country code). Examples: "en", "de_DE", "_GB", "en_US_WIN", "de__POSIX", "fr__MAC"
locale
- string representing a locale
public static boolean isBlank(java.lang.String str)
For example,
str
- the string to check
public static boolean isEmpty(java.lang.String value)
For example,
value
- the string to check
public static boolean isEqual(java.lang.String str1, java.lang.String str2)
java.lang.String#equals(String)
is used to compare two strings.
str1
- the string to comparestr2
- the string to compare
public static boolean isEqualIgnoreCase(java.lang.String str1, java.lang.String str2)
String.equalsIgnoreCase(String)
is used to compare two
strings.
str1
- the string to comparestr2
- the string to compare
public static java.lang.String doubleToString(double d, int fNumber)
Double.toString( double )
, and can
also handle very large number like 1.234567890E16 to "12345678900000000".
d
- the double value to convertfNumber
- the positive maximum fractional number
public static java.lang.String doubleToString(double d, int fNumber, com.ibm.icu.util.ULocale locale)
d
- the double value to convertfNumber
- the positive maximum fractional numberlocale
-
public static DimensionValue parse(java.lang.String value) throws PropertyValueException
value
- the dimension string to parse
PropertyValueException
- if the string is not validpublic static DimensionValue parseInput(java.lang.String value, com.ibm.icu.util.ULocale locale) throws PropertyValueException
The string must match the following:
value
- the string to parselocale
- the locale where the input string resides
PropertyValueException
- if the string is not validpublic static java.lang.String extractFileName(java.lang.String filePathName)
For example:
filePathName
- the file name with path and suffix
public static java.lang.String extractFileNameWithSuffix(java.lang.String filePathName)
For example:
filePathName
- the file name with path and suffix
public static java.lang.String extractNamespace(java.lang.String qualifiedName)
For example,
qualifiedName
- the qualified reference value
public static java.lang.String extractName(java.lang.String qualifiedName)
For example,
qualifiedName
- the qualified reference value
public static java.lang.String buildQualifiedReference(java.lang.String namespace, java.lang.String value)
For example,
namespace
- the library namespace to indicate which library the reference
is using.value
- the actual reference value
public static java.lang.String trimQuotes(java.lang.String value)
For example,
value
- the string may have quotes
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |