|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdea.common.Display
This class holds methods for formating page and debug output. TODO:This class needs some clean up to better wrapper log4j.
Field Summary |
Fields inherited from interface dea.common.IDebugLevels |
BASIC, DEBUG_ALL, ERROR, METH_DETAIL, METH_ENTER, METH_EXIT, METH_EXT, METH_GET, METH_SET, METH_VARS, SHOW_PASS |
Constructor Summary | |
Display()
|
Method Summary | |
static java.lang.String |
convertStr(java.lang.String s)
convert chars that will give SQL problems to chars that will not |
static long |
dateStr2val(java.lang.String yrStr,
java.lang.String mthStr,
java.lang.String dayStr,
java.lang.String hrStr,
java.lang.String minStr)
Convert date in from the form fields and converts it to a long |
static void |
dprint(int dlvl,
java.lang.String msg)
If debug is on then call logIt(String) for msg |
static void |
dprint(int dlvl,
java.lang.String msg,
boolean bool)
Print "message = true or false" if debug set |
static void |
dprint(int dlvl,
java.lang.String msg,
boolean[] aH)
Print boolean array values if debug set |
static void |
dprint(int dlvl,
java.lang.String msg,
byte[] aS)
Print int array values if debug set |
static void |
dprint(int dlvl,
java.lang.String msg,
char c)
|
static void |
dprint(int dlvl,
java.lang.String msg,
float f)
Print String "message = value" if debug set |
static void |
dprint(int dlvl,
java.lang.String msg,
int i)
Print String "message = value" if debug set |
static void |
dprint(int dlvl,
java.lang.String msg,
int[] aH)
Print int array values if debug set |
void |
dprint(int dlvl,
java.lang.String msg,
InternetAddress[] aIa)
Print InternetAddress array values if debug set |
static void |
dprint(int dlvl,
java.lang.String msg,
long l)
Print String "message = value" if debug set |
void |
dprint(int dlvl,
java.lang.String msg,
java.lang.Object obj)
Print value being retrieved if debug set. |
static void |
dprint(int dlvl,
java.lang.String msg,
java.util.Properties prop)
Print Properties keys and values if debug set |
static void |
dprint(int dlvl,
java.lang.String msg,
java.util.Set set)
Print Set values with class name if debug set |
static void |
dprint(int dlvl,
java.lang.String msg,
java.lang.String s)
Print String of "message = (value)" if debug set |
static void |
dprint(int dlvl,
java.lang.String msg,
java.lang.String[] aS)
Print String array values if debug set |
void |
dprint(int dlvl,
java.lang.String msg,
java.lang.Throwable e)
Print "message exception info" if debug set |
static void |
dprint(int dlvl,
java.lang.String msg,
java.sql.Timestamp timestamp)
Print String of "message = (value)" if debug set |
static java.lang.String |
exceptionToStr(java.lang.String msg,
java.lang.Throwable e)
Create a String from the message and Throwable passed. |
static java.lang.String |
getDayList(int select)
Generate options for day select list |
static int |
getDebug()
Get method for debug (debug level in force) |
static Display |
getInstance()
get singleton |
static java.lang.String |
getLogName()
|
static java.lang.String |
getMonthList(int select)
Generate options for month select list |
static java.lang.String |
getTimeList(java.lang.String select)
Generate options for time select list |
static java.lang.String |
getYearList(int select)
Generate options for year select list for this and the next 2 years |
static java.lang.String |
getYearList(int select,
int rangeFwd,
int rangeBak)
Generate options for year select list |
static java.lang.String |
isChecked(int button,
int val)
gen HTML to mark button CHECKED if data show it should be |
static java.lang.String |
isChecked(java.lang.String button,
java.lang.String val)
gen HTML to mark button CHECKED if data show it should be |
static void |
logIt(java.lang.String msg)
* Wrapper for log4j All messages sent at error level so we can alter debug level on the fly with out having to reset the server. |
static void |
logItOld(java.lang.String msg)
* Crude log for jsp debug. |
static void |
markLog(int dlvl,
java.lang.String msg)
If debug is on then call logIt(String) for msg |
static java.lang.String |
null2str(int i)
if String is null then return blank string |
static java.lang.String |
null2str(java.lang.String s)
if String is null then return blank string |
static void |
setDebug(int newDebug)
Set method for debug (debug level in force) |
static void |
setLogName(java.lang.String newLogName)
|
void |
showError(java.lang.String msg,
java.lang.Throwable e)
Prints out more than you want to know about a caught Exception. |
static int |
str2int(java.lang.String s)
return int from String or 0 if empty or invalid |
static long |
str2Long(java.lang.String s)
If String is null or invalid returns 0 otherwise the number the string represents. |
static java.lang.String |
truncStr(java.lang.String fullStr,
java.lang.String baseStr)
return a string that is s1 relative to s2 just a simple truncation for now if fullStr equals null or baseStr then return empty string |
static java.lang.String |
val2DateStr(java.lang.String timeStr,
java.lang.String fieldNameBase,
boolean showTime)
Convert date in the form of a long to form fields |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Display()
Method Detail |
public static Display getInstance()
public static java.lang.String getLogName()
public static void setLogName(java.lang.String newLogName)
public static long str2Long(java.lang.String s)
s
- number as a String.public static java.lang.String null2str(java.lang.String s)
public static java.lang.String null2str(int i)
public static java.lang.String convertStr(java.lang.String s)
s
- - source stringpublic static java.lang.String truncStr(java.lang.String fullStr, java.lang.String baseStr)
public static int str2int(java.lang.String s)
public static int getDebug()
public static void setDebug(int newDebug)
newDebug
- new debug levelpublic static java.lang.String exceptionToStr(java.lang.String msg, java.lang.Throwable e)
msg
- e
-
public void showError(java.lang.String msg, java.lang.Throwable e)
msg
- message to put in the header linee
- The Exception to get the error frompublic static java.lang.String isChecked(java.lang.String button, java.lang.String val)
button
- value of buttonval
- value to check against
public static java.lang.String isChecked(int button, int val)
button
- value of buttonval
- value to check against
public static void dprint(int dlvl, java.lang.String msg, int i)
dlvl
- print only if ((dlvl & bDebug) == dlvl)msg
- message to print.i
- value to printIDebugLevels
public static void dprint(int dlvl, java.lang.String msg, char c)
public static void dprint(int dlvl, java.lang.String msg, long l)
dlvl
- print only if ((dlvl & bDebug) == dlvl)msg
- message to print.l
- value to printIDebugLevels
public static void dprint(int dlvl, java.lang.String msg, float f)
dlvl
- print only if ((dlvl & bDebug) == dlvl)msg
- message to print.f
- value to printIDebugLevels
public void dprint(int dlvl, java.lang.String msg, java.lang.Object obj)
dlvl
- print only if ((dlvl & bDebug) == dlvl)msg
- message to print.obj
- object to printIDebugLevels
public static void dprint(int dlvl, java.lang.String msg, java.lang.String[] aS)
dlvl
- print only if ((dlvl & bDebug) == dlvl)msg
- message to print.aS
- array to printIDebugLevels
public void dprint(int dlvl, java.lang.String msg, InternetAddress[] aIa)
dlvl
- print only if ((dlvl & bDebug) == dlvl)msg
- message to print.aIa
- array to printIDebugLevels
public static void dprint(int dlvl, java.lang.String msg, boolean[] aH)
dlvl
- print only if ((dlvl & bDebug) == dlvl)msg
- message to print.aH
- array to printIDebugLevels
public static void dprint(int dlvl, java.lang.String msg, int[] aH)
dlvl
- print only if ((dlvl & bDebug) == dlvl)msg
- message to print.aH
- array to printIDebugLevels
public static void dprint(int dlvl, java.lang.String msg, byte[] aS)
dlvl
- print only if ((dlvl & bDebug) == dlvl)msg
- message to print.aS
- array to printIDebugLevels
public static void dprint(int dlvl, java.lang.String msg, java.util.Properties prop)
dlvl
- print only if ((dlvl & bDebug) == dlvl)msg
- message to print.prop
- Properties to printIDebugLevels
public static void dprint(int dlvl, java.lang.String msg, java.util.Set set)
dlvl
- print only if ((dlvl & bDebug) == dlvl)msg
- message to print.set
- Set to printIDebugLevels
public static void dprint(int dlvl, java.lang.String msg, java.lang.String s)
dlvl
- print only if ((dlvl & bDebug) == dlvl)msg
- message to print.s
- value to printIDebugLevels
public static void dprint(int dlvl, java.lang.String msg, java.sql.Timestamp timestamp)
dlvl
- print only if ((dlvl & bDebug) == dlvl)msg
- message to print.timestamp
- value to printIDebugLevels
public void dprint(int dlvl, java.lang.String msg, java.lang.Throwable e)
dlvl
- print only if ((dlvl & bDebug) == dlvl)msg
- message to print.e
- exception to print info ofIDebugLevels
public static void dprint(int dlvl, java.lang.String msg, boolean bool)
dlvl
- print only if ((dlvl & bDebug) == dlvl)msg
- message to print.bool
- boolean to printIDebugLevels
public static void dprint(int dlvl, java.lang.String msg)
logIt(String)
for msg
dlvl
- print only if ((dlvl & bDebug) == dlvl)msg
- message to print.IDebugLevels
public static void logIt(java.lang.String msg)
msg
- message to logpublic static void logItOld(java.lang.String msg)
msg
- message to logpublic static java.lang.String val2DateStr(java.lang.String timeStr, java.lang.String fieldNameBase, boolean showTime)
timeStr
- long as StringfieldNameBase
- base fro field namesshowTime
- add selection lists for time as well
public static long dateStr2val(java.lang.String yrStr, java.lang.String mthStr, java.lang.String dayStr, java.lang.String hrStr, java.lang.String minStr)
yrStr
- mthStr
- dayStr
- hrStr
- minStr
-
public static java.lang.String getMonthList(int select)
select
- default (CHECKED) option
public static java.lang.String getDayList(int select)
select
- default (CHECKED) option
public static java.lang.String getYearList(int select)
select
- default (CHECKED) option
public static java.lang.String getYearList(int select, int rangeFwd, int rangeBak)
select
- default (CHECKED) optionrangeFwd
- number of years forward to add to listrangeBak
- number of years back to add to list
public static java.lang.String getTimeList(java.lang.String select)
select
- default (CHECKED) option
public static void markLog(int dlvl, java.lang.String msg)
logIt(String)
for msg
dlvl
- print only if ((dlvl & bDebug) == dlvl)msg
- message to print.IDebugLevels
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |