| java.lang.Object org.ofbiz.base.util.UtilFormatOut
UtilFormatOut | public class UtilFormatOut (Code) | | General output formatting functions - mainly for helping in JSPs
author: David E. Jones author: Andy Zeneski version: $Revision: 1.6 $ since: 2.0 |
Method Summary | |
public static String | checkEmpty(String string1, String string2) Returns the first passed String if not empty, otherwise the second if not empty, otherwise an empty but non-null String. | public static String | checkEmpty(String string1, String string2, String string3) Returns the first passed String if not empty, otherwise the second if not empty, otherwise the third if not empty, otherwise an empty but non-null String. | public static String | checkNull(String string1) Checks to see if the passed string is null, if it is returns an empty but non-null string. | public static String | checkNull(String string1, String string2) Returns the first passed String if not null, otherwise the second if not null, otherwise an empty but non-null String. | public static String | checkNull(String string1, String string2, String string3) Returns the first passed String if not null, otherwise the second if not null, otherwise the third if not null, otherwise an empty but non-null String. | public static String | checkNull(String string1, String string2, String string3, String string4) Returns the first passed String if not null, otherwise the second if not null, otherwise the third if not null, otherwise the fourth if not null, otherwise an empty but non-null String. | public static String | decodeQueryValue(String query) | public static String | encodeQuery(String query) | public static String | encodeQueryValue(String query) | public static String | encodeXmlValue(String inString) | public static String | formatCurrency(double price, String isoCode, Locale locale) | public static String | formatCurrency(Double price, String isoCode, Locale locale) | public static String | formatDate(java.sql.Timestamp timestamp) | public static String | formatPaddedNumber(long number, int numericPadding) | public static String | formatPaddingRemove(String original) | public static String | formatPercentage(Double percentage) | public static String | formatPercentage(double percentage) | public static String | formatPrice(Double price) | public static String | formatPrice(double price) | public static String | formatQuantity(Long quantity) | public static String | formatQuantity(long quantity) | public static String | formatQuantity(Integer quantity) | public static String | formatQuantity(int quantity) | public static String | formatQuantity(Float quantity) | public static String | formatQuantity(float quantity) | public static String | formatQuantity(Double quantity) | public static String | formatQuantity(double quantity) | public static String | ifNotEmpty(String base, String pre, String post) Returns pre + base + post if base String is not null or empty, otherwise an empty but non-null String. | public static String | makeString(Object obj1) | public static String | replaceString(String mainString, String oldString, String newString) | public static String | safeToString(Object obj) |
checkEmpty | public static String checkEmpty(String string1, String string2)(Code) | | Returns the first passed String if not empty, otherwise the second if not empty, otherwise an empty but non-null String.
Parameters: string1 - The first passed String Parameters: string2 - The second passed String The first passed String if not empty, otherwise the second if not empty, otherwise an empty but non-null String |
checkEmpty | public static String checkEmpty(String string1, String string2, String string3)(Code) | | Returns the first passed String if not empty, otherwise the second if not empty, otherwise the third if not empty, otherwise an empty but non-null String.
Parameters: string1 - The first passed String Parameters: string2 - The second passed String Parameters: string3 - The third passed String The first passed String if not empty, otherwise the second if not empty, otherwise the third if not empty, otherwise an empty but non-null String |
checkNull | public static String checkNull(String string1)(Code) | | Checks to see if the passed string is null, if it is returns an empty but non-null string.
Parameters: string1 - The passed String The passed String if not null, otherwise an empty non-null String |
checkNull | public static String checkNull(String string1, String string2)(Code) | | Returns the first passed String if not null, otherwise the second if not null, otherwise an empty but non-null String.
Parameters: string1 - The first passed String Parameters: string2 - The second passed String The first passed String if not null, otherwise the second if not null, otherwise an empty but non-null String |
checkNull | public static String checkNull(String string1, String string2, String string3)(Code) | | Returns the first passed String if not null, otherwise the second if not null, otherwise the third if not null, otherwise an empty but non-null String.
Parameters: string1 - The first passed String Parameters: string2 - The second passed String Parameters: string3 - The third passed String The first passed String if not null, otherwise the second if not null, otherwise the third if not null, otherwise an empty but non-null String |
checkNull | public static String checkNull(String string1, String string2, String string3, String string4)(Code) | | Returns the first passed String if not null, otherwise the second if not null, otherwise the third if not null, otherwise the fourth if not null, otherwise an empty but non-null String.
Parameters: string1 - The first passed String Parameters: string2 - The second passed String Parameters: string3 - The third passed String Parameters: string4 - The fourth passed String The first passed String if not null, otherwise the second if not null, otherwise the third if not null, otherwise the fourth if not null, otherwise an empty but non-null String |
decodeQueryValue | public static String decodeQueryValue(String query)(Code) | | Decodes a single query value from an HTTP URL parameter, replacing %ASCII values with characters
Parameters: query - The encoded query value String The plain, decoded String |
encodeQuery | public static String encodeQuery(String query)(Code) | | Encodes an HTTP URL query String, replacing characters used for other things in HTTP URL query strings, but not touching the separator characters '?', '=', and '&'
Parameters: query - The plain query String The encoded String |
encodeQueryValue | public static String encodeQueryValue(String query)(Code) | | Encodes a single HTTP URL query value, replacing characters used for other things in HTTP URL query strings
Parameters: query - The plain query value String The encoded String |
encodeXmlValue | public static String encodeXmlValue(String inString)(Code) | | Encodes an XML string replacing the characters '<', '>', '"', ''', '&'
Parameters: inString - The plain value String The encoded String |
formatCurrency | public static String formatCurrency(double price, String isoCode, Locale locale)(Code) | | Formats a double into a properly formatted currency string based on isoCode and Locale
Parameters: price - The price double to be formatted Parameters: isoCode - the currency ISO code Parameters: locale - The Locale used to format the number A String with the formatted price |
formatCurrency | public static String formatCurrency(Double price, String isoCode, Locale locale)(Code) | | Formats a double into a properly formatted currency string based on isoCode and Locale
Parameters: price - The price Double to be formatted Parameters: isoCode - the currency ISO code Parameters: locale - The Locale used to format the number A String with the formatted price |
formatDate | public static String formatDate(java.sql.Timestamp timestamp)(Code) | | Formats a String timestamp into a nice string
Parameters: timestamp - String timestamp to be formatted A String with the formatted date/time |
formatPaddedNumber | public static String formatPaddedNumber(long number, int numericPadding)(Code) | | |
formatPercentage | public static String formatPercentage(Double percentage)(Code) | | Formats a Double representing a percentage into a string
Parameters: percentage - The percentage Double to be formatted A String with the formatted percentage |
formatPercentage | public static String formatPercentage(double percentage)(Code) | | Formats a double representing a percentage into a string
Parameters: percentage - The percentage double to be formatted A String with the formatted percentage |
formatPrice | public static String formatPrice(Double price)(Code) | | Formats a Double representing a price into a string
Parameters: price - The price Double to be formatted A String with the formatted price |
formatPrice | public static String formatPrice(double price)(Code) | | Formats a double representing a price into a string
Parameters: price - The price double to be formatted A String with the formatted price |
formatQuantity | public static String formatQuantity(Long quantity)(Code) | | Formats an Long representing a quantity into a string
Parameters: quantity - The quantity Long to be formatted A String with the formatted quantity |
formatQuantity | public static String formatQuantity(long quantity)(Code) | | Formats an int representing a quantity into a string
Parameters: quantity - The quantity long to be formatted A String with the formatted quantity |
formatQuantity | public static String formatQuantity(Integer quantity)(Code) | | Formats an Integer representing a quantity into a string
Parameters: quantity - The quantity Integer to be formatted A String with the formatted quantity |
formatQuantity | public static String formatQuantity(int quantity)(Code) | | Formats an int representing a quantity into a string
Parameters: quantity - The quantity int to be formatted A String with the formatted quantity |
formatQuantity | public static String formatQuantity(Float quantity)(Code) | | Formats a Float representing a quantity into a string
Parameters: quantity - The quantity Float to be formatted A String with the formatted quantity |
formatQuantity | public static String formatQuantity(float quantity)(Code) | | Formats a float representing a quantity into a string
Parameters: quantity - The quantity float to be formatted A String with the formatted quantity |
formatQuantity | public static String formatQuantity(Double quantity)(Code) | | Formats an Double representing a quantity into a string
Parameters: quantity - The quantity Double to be formatted A String with the formatted quantity |
formatQuantity | public static String formatQuantity(double quantity)(Code) | | Formats an double representing a quantity into a string
Parameters: quantity - The quantity double to be formatted A String with the formatted quantity |
ifNotEmpty | public static String ifNotEmpty(String base, String pre, String post)(Code) | | Returns pre + base + post if base String is not null or empty, otherwise an empty but non-null String.
Parameters: base - The base String Parameters: pre - The pre String Parameters: post - The post String pre + base + post if base String is not null or empty, otherwise an empty but non-null String. |
makeString | public static String makeString(Object obj1)(Code) | | Checks to see if the passed Object is null, if it is returns an empty but non-null string, otherwise calls toString() on the object
Parameters: obj1 - The passed Object The toString() of the passed Object if not null, otherwise an empty non-null String |
replaceString | public static String replaceString(String mainString, String oldString, String newString)(Code) | | Replaces all occurances of oldString in mainString with newString
Parameters: mainString - The original string Parameters: oldString - The string to replace Parameters: newString - The string to insert in place of the old mainString with all occurances of oldString replaced by newString |
|
|