|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.portal.utils.CommonUtils
public class CommonUtils
CommonUtils class contains base useful utilities
| Constructor Summary | |
|---|---|
CommonUtils()
|
|
| Method Summary | |
|---|---|
static String |
boolToStr(boolean bool)
This method returns the String representation of the given boolean value. |
static String |
envl(String sourceStr,
String replaceStr)
Replaces "sourceString" with "replaceString" if sourceString is null or empty |
static boolean[] |
getFamilyPropertyArrayBoolean(Hashtable hash,
String[] keys,
String propName)
|
static boolean[] |
getFamilyPropertyArrayBoolean(Hashtable hash,
String[] keys,
String propName,
boolean def)
|
static int[] |
getFamilyPropertyArrayInt(Hashtable hash,
String[] keys,
String propName)
|
static String[] |
getFamilyPropertyArrayString(Hashtable hash,
String[] keys,
String propName)
|
static String[] |
getFamilyPropertyArrayString(Hashtable hash,
String[] keys,
String propName,
String def)
|
static String[] |
getFamilyPropertyArrayString(Hashtable hash,
String[] keys,
String propName,
String[] def)
|
static String |
getFamilyPropertyString(Hashtable hash,
String key,
String propName,
String def)
|
static Hashtable |
getFamilyProps(Properties props,
String prefix,
String delim,
Properties defaultProps)
|
static int[] |
getSplitIntByCommas(String str,
String delim,
int def)
This method gets a properties of int from given string splitted by commas. |
static String[] |
getSplitStringByCommas(String str,
String delim)
This method gets an array of strings from given string splitted by commas. |
static Properties |
getSplitStringByCommas(String keys,
String values,
String delim)
This method gets a properties of strings from given string splitted by commas. |
static boolean |
isArrayEmpty(Object[] objects)
This method checks if an array of objects is empty or not. |
static boolean |
isArrayEmpty(String[] objects)
This method checks if an array of strings is empty or not. |
static String |
nvl(String sourceStr)
Replaces "sourceString" with "" if sourceString equals null |
static String |
nvl(String sourceStr,
String replaceStr)
Replaces "sourceString" with "replaceString" if sourceString equals null |
static String |
nvl(String sourceStr,
String replaceStr,
String prefix)
Replaces "sourceString" with "replaceString" if sourceString equals null |
static boolean |
odd(int i)
|
static boolean |
parseBoolean(String str)
This method returns the boolean value for the given String representation ("yes"-"no"). |
static boolean |
parseBoolean(String str,
boolean defaultValue)
|
static int |
parseInt(String str)
|
static int |
parseInt(String str,
int defaultValue)
|
static void |
replaceSubstVariables(Hashtable original,
Hashtable subst)
|
static String |
replaceText(String text,
String replacedString,
String newString)
replaces "replacedString" with "newString" in "text" |
static void |
setNoCache(HttpServletResponse res)
Sets "no cache" directives to the given response |
static String |
stackTraceToString(Exception e)
|
static boolean |
strToBool(String bool)
This method returns the boolean value for the given String representation ("true"-"false"). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CommonUtils()
| Method Detail |
|---|
public static void setNoCache(HttpServletResponse res)
res - HttpServletResponse response
public static String nvl(String sourceStr,
String replaceStr)
sourceStr - the string to replacereplaceStr - the replacement string
public static String envl(String sourceStr,
String replaceStr)
sourceStr - the string to replacereplaceStr - the replacement string
public static String nvl(String sourceStr,
String replaceStr,
String prefix)
sourceStr - the string to replacereplaceStr - the replacement stringprefix - the prefix
public static String nvl(String sourceStr)
sourceStr - string to replace
public static String replaceText(String text,
String replacedString,
String newString)
text - text where to replacereplacedString - string to replacenewString - new string
public static void replaceSubstVariables(Hashtable original,
Hashtable subst)
public static String stackTraceToString(Exception e)
public static String[] getSplitStringByCommas(String str,
String delim)
str - a string valuedelim - a delimeter
public static Properties getSplitStringByCommas(String keys,
String values,
String delim)
keys - a string keys for propertiesvalues - a string valuedelim - a delimeter
public static int[] getSplitIntByCommas(String str,
String delim,
int def)
str - a string keys for propertiesdelim - a delimeterdef - a default value
public static Hashtable getFamilyProps(Properties props,
String prefix,
String delim,
Properties defaultProps)
public static String[] getFamilyPropertyArrayString(Hashtable hash,
String[] keys,
String propName,
String[] def)
public static String getFamilyPropertyString(Hashtable hash,
String key,
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 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 boolean parseBoolean(String str,
boolean defaultValue)
public static String boolToStr(boolean bool)
bool - a value of boolean type
public static boolean strToBool(String bool)
bool - a String value
public static boolean parseBoolean(String str)
str - a String value
public static int parseInt(String str,
int defaultValue)
public static int parseInt(String str)
public static boolean odd(int i)
public static boolean isArrayEmpty(Object[] objects)
objects - an array of objects
public static boolean isArrayEmpty(String[] objects)
objects - an array of strings
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||