public class TranslationUtils extends Object
Constructor and Description |
---|
TranslationUtils()
TranslationUtils instances should NOT be constructed in standard programming. |
Modifier and Type | Method and Description |
---|---|
static boolean |
containsPattern(String string,
String pattern)
Returns true if the specified pattern with braces around it, like so: "{pattern}" exists in the string.
|
static String |
deleteWhitespace(Object object)
Calls the object's toString method and deletes any whitespace from the value.
|
static Object |
getProperty(Object bean,
String property)
Just retrieves properties from a bean, but gives a more informational error when the property can't be
retrieved, it also cleans the resulting property from any excess white space
|
static String |
getPropertyAsString(Object bean,
String property)
Just retrieves properties from a bean, but gives a more informational error when the property can't be
retrieved, it also cleans the resulting property from any excess white space
|
static String |
getStartingProperty(String property)
Retrieves the "starting" property name from one that is nested, for example, will return '
|
static String |
removeExtraWhitespace(String string)
Removes any extra whitespace.
|
static String |
replaceFirstPattern(String string,
String pattern,
String replaceWith)
Searches for and replaces the specified pattern with braces around it, like so: "{pattern}" the first time it
occurs in the string
|
static String |
replacePattern(String string,
String pattern,
String replaceWith)
Searches for and replaces the specified pattern with braces around it, like so: "{pattern}" every time it
occurs in the string.
|
static String |
trimToEmpty(Object object)
Calls the object's toString method and trims the value.
|
public TranslationUtils()
TranslationUtils
instances should NOT be constructed in standard programming. Instead, the class
should be used as TranslationUtils.replacePattern(" some pattern ");
.
This constructor is public to permit tools that require a JavaBean instance to operate.
public static String replacePattern(String string, String pattern, String replaceWith)
string
- the string to to perform replacement on.pattern
- the pattern to findreplaceWith
- the pattern to place the existing one with.public static String replaceFirstPattern(String string, String pattern, String replaceWith)
string
- the string to to perform replacement on.pattern
- the pattern to findreplaceWith
- the pattern to place the existing one with.public static boolean containsPattern(String string, String pattern)
string
- the string to to perform replacement on.pattern
- the pattern to findpublic static String trimToEmpty(Object object)
object
- the object to use.public static String deleteWhitespace(Object object)
object
- the object to deleteWhite space from.public static String getStartingProperty(String property)
property
- the property.public static String removeExtraWhitespace(String string)
string
- the stringpublic static Object getProperty(Object bean, String property)
bean
- the bean from which to retrieve the propertyproperty
- the property namepublic static String getPropertyAsString(Object bean, String property)
bean
- the bean from which to retrieve the propertyproperty
- the property nameCopyright © 2003–2014 AndroMDA.org. All rights reserved.