| java.lang.Object com.salmonllc.util.Util
Util | public class Util (Code) | | This class is used to hold general helper methods
|
Method Summary | |
public static String | addAndFilter(String filter, String add) This method was created in VisualAge. | public static void | addAndFilter(StringBuffer filter, String add) This method was created in VisualAge. | public static String | addHtmlComment(String commentStr) This method returns what you passed in as a Html Comment. | public static String | addOrFilter(String filter, String add) This method was created in VisualAge. | public static void | addOrFilter(StringBuffer filter, String add) This method was created in VisualAge. | public static void | addSPParameter(StringBuffer paramString, String add, int type) This method was created in VisualAge. | public static String | addToINClause(String clause, String add, int type) This method was created in VisualAge. | public static void | executeMethod(Object comp, String propertyName, Object value) This method will will automatically set a property value on the specified component. | public static void | executeReflectedMethod(Object comp, Method meth, Object value) This method is used to execute set methods indirectly. | public static Throwable | getCause(Exception e) | public static java.sql.Date | getDateObject(int iYear, int iMonth, int iDay, int iHour, int iMinute) | public static int | getDaysElapsed(java.sql.Timestamp compDate) Returns the number of whole days that have elapsed from a given day to
today. | public HtmlScript | getPrintScript(HtmlSubmitImage submitBtn, HtmlPage p) This method returns a HTML script that opens the print dialog box of the browser. | public static int | indexOfOccurence(String searchStr, String source, int numOfOcurrence) This method finds the nth occurrence of a string within another string and return the location within the source string
Parameters: searchStr - is the string to search for. Parameters: source - is the string to be searched. Parameters: numOfOcurrence - is the number of occurrence we are looking for. | public static boolean | instanceOf(Class class1, Class class2) | public static boolean | isDouble(String s) This method checks to see if the string passed into it is a double value. | public static boolean | isEmpty(Object objToCheck) | public static boolean | isFilled(String s) This method checks to see if the string passed into it contains any letters or digits. | public static boolean | isInteger(String s) This method checks to see if the string passed into it is an integer value. | public static boolean | isNull(Object objToCheck) | public static boolean | isNumeric(String s) This method checks to see if the string passed into it contains all numeric digits. | public static boolean | isTrue(int intToCheck) Check an int and returns if it resolves to true boolean value. | public static boolean | isTrue(String strToCheck) Check a string and returns if it resolves to true boolean value. | public static int | javaClassToDataStoreType(String val) | public static void | makeSureNotNull(DataStore ds, int row, String colName) This method checks a column to see if it has been filled. | public static void | makeSureNotNull(DataStore ds, int row, String colName, Object defaultVal) This method checks a column to see if it has been filled. | public static void | makeSureNotNull(DataStore ds, String colName) This method checks a column to see if it has been filled. | final public static String | padString(String sPassed, int iPadLength, char cPadChar) This function is used to pad a string to the specified length with a specific character and return this created string.
If passed String is greater than iPadLength than the string is chopped to that length.
Parameters: sPassed - String - the string to be padded. Parameters: iPadLength - int - the length of the resulting string. Parameters: cPadChar - char - the character to pad the string with. | final public static String | padStringInFront(String sPassed, int iPadLength, char cPadChar) This function is used to pad a string in the front to the specified length with a specific character and return this created string.
If passed String is greater than iPadLength than the string is chopped to that length.
Parameters: sPassed - String - the string to be padded. Parameters: iPadLength - int - the length of the resulting string. Parameters: cPadChar - char - the character to pad the string with. | public static String | replaceString(String source, String searchStr, String replaceStr) This method replaces strings within another string with a third specified string Usage: replaceString(StringBuffer soucre, String searchStr, String replaceStr)
replaces all occurences
Parameters: source - is the string to be searched. Parameters: searchStr - is the string to search for. Parameters: replaceStr - is the string that replaces searchStr in soucre. | public static String | replaceString(String source, String searchStr, String replaceStr, int startOcurrence, int numOfOccurences) This method replaces strings within another string with a third specified string Usage: replaceString(StringBuffer soucre, String searchStr, String replaceStr, int startOcurrence, int numOfOccurences)
Parameters: source - is the string to be searched. Parameters: searchStr - is the string to search for. Parameters: replaceStr - is the string that replaces searchStr in soucre. | public static void | setTo100Percent(HtmlDataTable dataTable) | public static void | setTo100Percent(HtmlDisplayBox dispBox) | public static void | setTo100Percent(HtmlTable table) | public static String[] | split(String st, String delimiter) | public static int | stringCount(String source, String searchStr) | public static boolean | stringToBoolean(String val) | public static boolean | stringToBoolean(String val, boolean def) | public static Color | stringToColor(String s) This method will return the Color-object equivalent of a string
Parameters: s - - colr passed as a string. | public static int | stringToInt(String val) | public static String | stripChars(String s) This method returns a new string containing only letters and numeric digits in the original string. | public static String | stripChars(String source, String allowedChars, String disallowedChars) This method returns a new string with only the allowed characters and no disallowed characters. | public static String | stripDotJsp(String s) This method returns a new string containing only the root string with no .jsp. | public static String | stripHtmlFromText(String stripString) | public static String | stripSpecialChars(String sField) This method returns a string containing only digits and the decimal point. | public static java.sql.Date | timeToDate(java.sql.Timestamp timeStampToConvert) | public static String | urlEncode(String s) This method will remove illegal characters for strings so they can be placed in a url link. | public static String | urlEncode(String s, boolean encodeFull) This method will remove illegal characters for strings so they can be placed in a url link. |
addAndFilter | public static String addAndFilter(String filter, String add)(Code) | | This method was created in VisualAge.
Parameters: filter - java.lang.String Parameters: add - java.lang.String java.lang.String |
addAndFilter | public static void addAndFilter(StringBuffer filter, String add)(Code) | | This method was created in VisualAge.
Parameters: filter - java.lang.String Parameters: add - java.lang.String |
addHtmlComment | public static String addHtmlComment(String commentStr)(Code) | | This method returns what you passed in as a Html Comment.
Parameters: commentStr - - String that will be wrapped in an html comment String |
addOrFilter | public static String addOrFilter(String filter, String add)(Code) | | This method was created in VisualAge.
Parameters: filter - java.lang.String Parameters: add - java.lang.String java.lang.String |
addOrFilter | public static void addOrFilter(StringBuffer filter, String add)(Code) | | This method was created in VisualAge.
Parameters: filter - java.lang.String Parameters: add - java.lang.String |
addSPParameter | public static void addSPParameter(StringBuffer paramString, String add, int type)(Code) | | This method was created in VisualAge.
Parameters: paramString - java.lang.String Parameters: add - java.lang.String Parameters: type - int type of param |
addToINClause | public static String addToINClause(String clause, String add, int type)(Code) | | This method was created in VisualAge.
Parameters: clause - java.lang.String Parameters: add - java.lang.String Parameters: type - int type of param java.lang.String |
executeMethod | public static void executeMethod(Object comp, String propertyName, Object value) throws NoSuchMethodException(Code) | | This method will will automatically set a property value on the specified component. This can be used for example to make a component invisible or visible depending on the value in the datastore for a particular row: ex: addPropertyExpression(comp,"visible","bucket==1") will call the setVisible method on the component comp passing the results of the expression.
Parameters: comp - The component to set the property for Parameters: propertyName - The name of the property to set. The component must have a corresponding setProperty method or this method will throw a NoSuchMethodException Parameters: value - - The value being passed to the method exception: NoSuchMethodException - The exception description. |
executeReflectedMethod | public static void executeReflectedMethod(Object comp, Method meth, Object value)(Code) | | This method is used to execute set methods indirectly.
Parameters: comp - DOCUMENT ME! Parameters: meth - DOCUMENT ME! Parameters: value - DOCUMENT ME! |
getCause | public static Throwable getCause(Exception e)(Code) | | Returns the cause for the exception, JDK 1.4 and above only
Parameters: e - |
getDateObject | public static java.sql.Date getDateObject(int iYear, int iMonth, int iDay, int iHour, int iMinute)(Code) | | |
getDaysElapsed | public static int getDaysElapsed(java.sql.Timestamp compDate)(Code) | | Returns the number of whole days that have elapsed from a given day to
today. If the given day is today, it will return zero. If the day
is yesterday, it will return 1, etc. If the given day is in the future,
the reult will be a negative number.
Parameters: comDate - - the date to compare to int |
getPrintScript | public HtmlScript getPrintScript(HtmlSubmitImage submitBtn, HtmlPage p)(Code) | | This method returns a HTML script that opens the print dialog box of the browser.
Parameters: submitBtn - - Button that will get the script added to it Parameters: p - - Page HtmlScript |
indexOfOccurence | public static int indexOfOccurence(String searchStr, String source, int numOfOcurrence)(Code) | | This method finds the nth occurrence of a string within another string and return the location within the source string
Parameters: searchStr - is the string to search for. Parameters: source - is the string to be searched. Parameters: numOfOcurrence - is the number of occurrence we are looking for. int index of occurence |
instanceOf | public static boolean instanceOf(Class class1, Class class2)(Code) | | Returns true if class2 is a subclass of class1
Parameters: class1 - Parameters: class2 - |
isDouble | public static boolean isDouble(String s)(Code) | | This method checks to see if the string passed into it is a double value. It returns true if the string parses to a double.
Parameters: s - java.lang.String boolean If the String is a double value |
isEmpty | public static boolean isEmpty(Object objToCheck)(Code) | | Checks a String to see if it is empty ""
Parameters: objToCheck - - object to check boolean true if it is empty |
isFilled | public static boolean isFilled(String s)(Code) | | This method checks to see if the string passed into it contains any letters or digits. It returns a true or false value whether or not the string has any characters in it.
Parameters: s - java.lang.String boolean |
isInteger | public static boolean isInteger(String s)(Code) | | This method checks to see if the string passed into it is an integer value. It returns true if the string parses to an integer.
Parameters: s - java.lang.String boolean If the String is an integer value |
isNull | public static boolean isNull(Object objToCheck)(Code) | | Checks an Object to see if it is null
Parameters: objToCheck - - object to check boolean true if it is null |
isNumeric | public static boolean isNumeric(String s)(Code) | | This method checks to see if the string passed into it contains all numeric digits. It returns true if the string contains only digits.
Parameters: s - java.lang.String boolean If the String is numeric |
isTrue | public static boolean isTrue(int intToCheck)(Code) | | Check an int and returns if it resolves to true boolean value. numbers greater then 0 are treated as true
Parameters: intToCheck - - Int to check boolean |
isTrue | public static boolean isTrue(String strToCheck)(Code) | | Check a string and returns if it resolves to true boolean value. numbers greater then 0 are treated as true
Parameters: strToCheck - - String to check boolean |
javaClassToDataStoreType | public static int javaClassToDataStoreType(String val)(Code) | | Maps a string to a datastore datatype constant
Parameters: val - int value that is DataStore.DATATYPE_ |
makeSureNotNull | public static void makeSureNotNull(DataStore ds, int row, String colName) throws Exception(Code) | | This method checks a column to see if it has been filled. If it has not been filled it with a safe value.
Parameters: ds - DataStore the datastore to use during checking Parameters: row - int Parameters: colName - String throws: Exception - - if column is not found |
makeSureNotNull | public static void makeSureNotNull(DataStore ds, int row, String colName, Object defaultVal) throws Exception(Code) | | This method checks a column to see if it has been filled. If it has not been filled it with a safe value.
Parameters: ds - DataStore the datastore to use during checking Parameters: row - - row to check Parameters: colName - - column to check Parameters: defaultVal - - Object You can specify what your defaultvalue should be. throws: Exception - - if column is not found |
makeSureNotNull | public static void makeSureNotNull(DataStore ds, String colName) throws Exception(Code) | | This method checks a column to see if it has been filled. If it has not been filled it with a safe value.
Parameters: ds - DataStore the datastore to use during checking Parameters: colName - - column to check throws: Exception - - if column is not found |
padString | final public static String padString(String sPassed, int iPadLength, char cPadChar)(Code) | | This function is used to pad a string to the specified length with a specific character and return this created string.
If passed String is greater than iPadLength than the string is chopped to that length.
Parameters: sPassed - String - the string to be padded. Parameters: iPadLength - int - the length of the resulting string. Parameters: cPadChar - char - the character to pad the string with. String - the padded string of the operation. |
padStringInFront | final public static String padStringInFront(String sPassed, int iPadLength, char cPadChar)(Code) | | This function is used to pad a string in the front to the specified length with a specific character and return this created string.
If passed String is greater than iPadLength than the string is chopped to that length.
Parameters: sPassed - String - the string to be padded. Parameters: iPadLength - int - the length of the resulting string. Parameters: cPadChar - char - the character to pad the string with. String - the padded string of the operation. |
replaceString | public static String replaceString(String source, String searchStr, String replaceStr)(Code) | | This method replaces strings within another string with a third specified string Usage: replaceString(StringBuffer soucre, String searchStr, String replaceStr)
replaces all occurences
Parameters: source - is the string to be searched. Parameters: searchStr - is the string to search for. Parameters: replaceStr - is the string that replaces searchStr in soucre. If omitted, replacement is the empty string. DOCUMENT ME! |
replaceString | public static String replaceString(String source, String searchStr, String replaceStr, int startOcurrence, int numOfOccurences)(Code) | | This method replaces strings within another string with a third specified string Usage: replaceString(StringBuffer soucre, String searchStr, String replaceStr, int startOcurrence, int numOfOccurences)
Parameters: source - is the string to be searched. Parameters: searchStr - is the string to search for. Parameters: replaceStr - is the string that replaces searchStr in soucre. If omitted, replacement is the empty string. Parameters: startOcurrence - is the first occurrence of searchStr that is replaced. If omitted, the first occurrence is used. Parameters: numOfOccurences - is the number of occurrences of searchStr that are replaced. If omitted, all occurrences are replaced. DOCUMENT ME! |
setTo100Percent | public static void setTo100Percent(HtmlDataTable dataTable)(Code) | | This method sets the width of the passed in HtmlDataTable to 100 percent
Parameters: dataTable - - HtmlDataTable to be sized |
setTo100Percent | public static void setTo100Percent(HtmlDisplayBox dispBox)(Code) | | This method sets the width of the passed in HtmlDisplayBox to 100 percent
Parameters: dispBox - - HtmlDisplayBox to be sized |
setTo100Percent | public static void setTo100Percent(HtmlTable table)(Code) | | This method sets the width of the passed in HtmlDisplayBox to 100 percent
Parameters: table - - HtmlTable to be sized |
split | public static String[] split(String st, String delimiter)(Code) | | Splits a String into an array of Strings based on a delimiter
Parameters: st - |
stringCount | public static int stringCount(String source, String searchStr)(Code) | | This method Counts the number of occurences of one string within another
Parameters: source - - String to be searched in Parameters: searchStr - - String that is tring to be found number of occurences |
stringToBoolean | public static boolean stringToBoolean(String val)(Code) | | Attempts to convert a string into its boolean equivalent; otherwise returns the true
Parameters: val - - String to be converted boolean |
stringToBoolean | public static boolean stringToBoolean(String val, boolean def)(Code) | | Attempts to convert a string into its boolean equivalent; otherwise returns the default
Parameters: val - java.lang.String Parameters: def - boolean boolean |
stringToColor | public static Color stringToColor(String s)(Code) | | This method will return the Color-object equivalent of a string
Parameters: s - - colr passed as a string. Color |
stringToInt | public static int stringToInt(String val)(Code) | | Converts a string to an int or returns -1 if it can't
Parameters: val - - value to convert int |
stripChars | public static String stripChars(String s)(Code) | | This method returns a new string containing only letters and numeric digits in the original string.
Parameters: s - java.lang.String string to be stripped of all characters other than letters or digits java.lang.String the new string containing only letters or digits |
stripChars | public static String stripChars(String source, String allowedChars, String disallowedChars)(Code) | | This method returns a new string with only the allowed characters and no disallowed characters.
Parameters: source - java.lang.String source string Parameters: allowedChars - a String containing the characters allowed to be in the resulting string. Parameters: disallowedChars - a String containing the characters disallowed to be in the resulting string the new formatted string containing the allowed characters and not containing the disallowed characters. |
stripDotJsp | public static String stripDotJsp(String s)(Code) | | This method returns a new string containing only the root string with no .jsp.
Parameters: s - java.lang.String string to be stripped java.lang.String the new string containing only root string. |
stripHtmlFromText | public static String stripHtmlFromText(String stripString)(Code) | | Removes the html from an html string and leaves only the text
Parameters: stripString - - String to strip html from - stripped String |
stripSpecialChars | public static String stripSpecialChars(String sField)(Code) | | This method returns a string containing only digits and the decimal point.
Parameters: sField - java.lang.String java.lang.String a string containing only digits and the decimal point |
timeToDate | public static java.sql.Date timeToDate(java.sql.Timestamp timeStampToConvert)(Code) | | Convert a java.sql.Timestamp to a valid java.sql.Date
Parameters: timeStampToConvert - - Timestamp to convert valid java.sql.Date if a null is passed in a null is back out |
urlEncode | public static String urlEncode(String s)(Code) | | This method will remove illegal characters for strings so they can be placed in a url link.
Parameters: s - - string to work on - encoded String |
urlEncode | public static String urlEncode(String s, boolean encodeFull)(Code) | | This method will remove illegal characters for strings so they can be placed in a url link.
Parameters: s - - string to work on Parameters: encodeFull - - whether to encode all characters - encoded String |
|
|