All Packages  Class Hierarchy  This Package  Previous  Next  Index


Class com.abc.templates.StandartValidator

java.lang.Object
   |
   +----com.abc.templates.StandartValidator

public class StandartValidator
extends Object
implements IValidator, IFillTableRow

This is predefined validator to validate user input. If you want to use this validator you must have HtmlTable control with name "error" in your template file.

Example:

<Table name="error" visible="0" border="1">
<tr>
    <th> <center><font color="@ERROR@">Folowing errors have been found</font></center></th>
</tr>
<tr>
    <td name="err" prefix='<center><font color="@ERRORS@">' suffix="</font></center>"></td>
</tr>
</Table>

Standart validator supprots folowing valid formats:

d    -    date is expected.

i2,4    -    number is expected and it must be >= 2 and <=4. You can omit any number example: i,4.

s2,4    -    string is expected with length from 2 to 4 symbols. You can not omit both of parameters ( because it does not makeany sense).

Example: <input type="text" name="Date" validtype="d" helpword="Date">.


 o StandartValidator()
constructor.
 o StandartValidator(boolean bAllowEmpty)
constructor. But if bAllowEmpty == true then it will accept empty entry as valid.
 o addError(String)
adds error to error table. If you want to add your own error you need to call afterRead manually.
 o afterRead(Template)
called by template object. Usually you do not need to call this method.
 o beforeRead(Template)
called by template object. Usually you do not need to call this method.
 o fillTableRow(int, HtmlTable, HtmlWriter)
HtmlTable will call that method to populate error table.
 o validate(String sValue, String sWord, String sValidForma)
HtmlText control calls this method to validate user input.

 o StandartValidator
public StandartValidator()

 o StandartValidator

public StandartValidator(boolean bAllowEmpty)

 o addError
public final void addError(String sError)

 o afterRead
public void afterRead(Template template)

 o beforeRead
public void beforeRead(Template template)

 o fillTableRow
public boolean fillTableRow(int iRow,
                             HtmlTable table,
                             HtmlWriter out) throws Exception

 o validate
public final boolean validate(String sValue,
                               String sWord,
                               String sValidFormat)


All Packages  Class Hierarchy  This Package  Previous  Next  Index