|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--DBWeb.ErrorRecord
A utility class that represents errors accumulated in checking a user's input form. In addition, it also stores warnings, separately.
Constructor Summary | |
ErrorRecord()
|
Method Summary | |
void |
add(java.lang.String field,
java.lang.String msg)
Adds the msg to messages associated with field. |
void |
addWarning(java.lang.String field,
java.lang.String msg)
Adds (as warning) the msg to messages associated with field. |
java.lang.String |
checkDate(java.lang.String field,
java.lang.String s)
Checks that s is parsable as a date in one of the formats known to Entity. |
java.lang.String |
checkDate(java.lang.String field,
java.lang.String s,
java.text.DateFormat df)
checkDate() checks to make sure that the given data is in the form required. |
void |
checkString(java.lang.String field,
java.lang.String s)
|
void |
checkString(java.lang.String field,
java.lang.String encodedString,
int maxlength)
checkString() adds an error if the input string is longer than the specified maximum number of characters (default 255) after being expanded by HTMLEncode() |
void |
checkStrings(Entity b,
java.lang.String fields)
As a convenience, we provide a method that iterates over all the field names in fields, extracts the corresponding field from the Entity argument b, and checks that the string is not too long to store (>255 chars) after HTML encoding. |
boolean |
isEmpty()
isEmpty() says whether there are no errors accumulated. |
java.lang.String |
toHtml()
toHtml() produces the appropriate HTML to display any error messages accumulated in ErrorRecord. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ErrorRecord()
Method Detail |
public boolean isEmpty()
public void add(java.lang.String field, java.lang.String msg)
public void addWarning(java.lang.String field, java.lang.String msg)
public void checkString(java.lang.String field, java.lang.String encodedString, int maxlength)
public void checkString(java.lang.String field, java.lang.String s)
public void checkStrings(Entity b, java.lang.String fields)
public java.lang.String checkDate(java.lang.String field, java.lang.String s, java.text.DateFormat df)
public java.lang.String checkDate(java.lang.String field, java.lang.String s)
public java.lang.String toHtml()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |