| java.lang.Object org.jasig.portal.utils.CommonUtils
CommonUtils | public class CommonUtils (Code) | | CommonUtils class contains base useful utilities
author: Michael Ivanov version: $Revision: 34793 $ |
Method Summary | |
public static String | boolToStr(boolean bool) This method returns the String representation of the given boolean value. | public static String | envl(String sourceStr, String replaceStr) | public static boolean[] | getFamilyPropertyArrayBoolean(Hashtable hash, String[] keys, String propName, boolean def) | public static boolean[] | getFamilyPropertyArrayBoolean(Hashtable hash, String[] keys, String propName) | public static int[] | getFamilyPropertyArrayInt(Hashtable hash, String[] keys, String propName) | public static String[] | getFamilyPropertyArrayString(Hashtable hash, String[] keys, String propName, String[] def) | public static String[] | getFamilyPropertyArrayString(Hashtable hash, String[] keys, String propName, String def) | public static String[] | getFamilyPropertyArrayString(Hashtable hash, String[] keys, String propName) | public static String | getFamilyPropertyString(Hashtable hash, String key, String propName, String def) | public static Hashtable | getFamilyProps(Properties props, String prefix, String delim, Properties defaultProps) | public static int[] | getSplitIntByCommas(String str, String delim, int def) This method gets a properties of int from given string splitted by commas. | public static String[] | getSplitStringByCommas(String str, String delim) This method gets an array of strings from given string splitted by commas. | public static Properties | getSplitStringByCommas(String keys, String values, String delim) This method gets a properties of strings from given string splitted by commas. | public static boolean | isArrayEmpty(Object objects) This method checks if an array of objects is empty or not. | public static boolean | isArrayEmpty(String objects) This method checks if an array of strings is empty or not. | public static String | nvl(String sourceStr, String replaceStr) | public static String | nvl(String sourceStr, String replaceStr, String prefix) | public static String | nvl(String sourceStr) | public static boolean | odd(int i) | public static boolean | parseBoolean(String str, boolean defaultValue) | public static boolean | parseBoolean(String str) This method returns the boolean value for the given String representation ("yes"-"no"). | public static int | parseInt(String str, int defaultValue) | public static int | parseInt(String str) | public static void | replaceSubstVariables(Hashtable original, Hashtable subst) | public static String | replaceText(String text, String replacedString, String newString) | public static void | setNoCache(HttpServletResponse res) | public static String | stackTraceToString(Exception e) | public static boolean | strToBool(String bool) This method returns the boolean value for the given String representation ("true"-"false"). |
boolToStr | public static String boolToStr(boolean bool)(Code) | | This method returns the String representation of the given boolean value.
Parameters: bool - a value of boolean type "true" if bool is true, "false" - otherwise |
envl | public static String envl(String sourceStr, String replaceStr)(Code) | | Replaces "sourceString" with "replaceString" if sourceString is null or empty
Parameters: sourceStr - the string to replace Parameters: replaceStr - the replacement string the processed string |
getFamilyPropertyArrayBoolean | public static boolean[] getFamilyPropertyArrayBoolean(Hashtable hash, String[] keys, String propName, boolean def)(Code) | | |
getFamilyPropertyArrayBoolean | public static boolean[] getFamilyPropertyArrayBoolean(Hashtable hash, String[] keys, String propName)(Code) | | |
getSplitIntByCommas | public static int[] getSplitIntByCommas(String str, String delim, int def)(Code) | | This method gets a properties of int from given string splitted by commas.
Parameters: str - a string keys for properties Parameters: delim - a delimeter Parameters: def - a default value an array of int |
getSplitStringByCommas | public static String[] getSplitStringByCommas(String str, String delim)(Code) | | This method gets an array of strings from given string splitted by commas.
Parameters: str - a string value Parameters: delim - a delimeter an array of strings |
getSplitStringByCommas | public static Properties getSplitStringByCommas(String keys, String values, String delim)(Code) | | This method gets a properties of strings from given string splitted by commas.
Parameters: keys - a string keys for properties Parameters: values - a string value Parameters: delim - a delimeter an array of strings |
isArrayEmpty | public static boolean isArrayEmpty(Object objects)(Code) | | This method checks if an array of objects is empty or not.
Parameters: objects - an array of objects true if array is empty, false - otherwise |
isArrayEmpty | public static boolean isArrayEmpty(String objects)(Code) | | This method checks if an array of strings is empty or not.
Parameters: objects - an array of strings true if array is empty, false - otherwise |
nvl | public static String nvl(String sourceStr, String replaceStr)(Code) | | Replaces "sourceString" with "replaceString" if sourceString equals null
Parameters: sourceStr - the string to replace Parameters: replaceStr - the replacement string the processed string |
nvl | public static String nvl(String sourceStr, String replaceStr, String prefix)(Code) | | Replaces "sourceString" with "replaceString" if sourceString equals null
Parameters: sourceStr - the string to replace Parameters: replaceStr - the replacement string Parameters: prefix - the prefix the processed string |
nvl | public static String nvl(String sourceStr)(Code) | | Replaces "sourceString" with "" if sourceString equals null
Parameters: sourceStr - string to replace the processed string |
odd | public static boolean odd(int i)(Code) | | |
parseBoolean | public static boolean parseBoolean(String str, boolean defaultValue)(Code) | | |
parseBoolean | public static boolean parseBoolean(String str)(Code) | | This method returns the boolean value for the given String representation ("yes"-"no").
Parameters: str - a String value true if str is "yes", false - otherwise |
parseInt | public static int parseInt(String str, int defaultValue)(Code) | | |
replaceText | public static String replaceText(String text, String replacedString, String newString)(Code) | | replaces "replacedString" with "newString" in "text"
Parameters: text - text where to replace Parameters: replacedString - string to replace Parameters: newString - new string new text |
setNoCache | public static void setNoCache(HttpServletResponse res)(Code) | | Sets "no cache" directives to the given response
Parameters: res - HttpServletResponse response |
strToBool | public static boolean strToBool(String bool)(Code) | | This method returns the boolean value for the given String representation ("true"-"false").
Parameters: bool - a String value true if bool is "true", false - otherwise |
|
|