All Packages  Class Hierarchy  This Package  Previous  Next  Index


Interface com.abc.templates.IValidator

public interface IValidator

If you want you can write your own validator and use it as you are using StandartValidator. Your validator must implement this interface.
Only controls with type = "text" can validate their values.
Example( with standard validator):
<input type="text" name="Age" validtype="i18,70" helpword="Age">

This control will validate himself and accept only age from 18 to 70 ( both included).

See more help on StandartValidator


 o afterRead(Template)
afterRead will be called after all controls has read themselves from HttpServletRequest
 o beforeRead(Template)
This method will be called before controls start to read themselves from HttpServletRequest
 o validate(String, String, String)
This method will be called to validate user input. Only control with type="text" calls that method.

 o afterRead
public abstract void afterRead(Template template)

afterRead will be called after all controls has read themselves from HttpRequest.
Parameters:
template - current template object. You can use it to make errors messages visible.

 o beforeRead
public abstract void beforeRead(Template template)

This method will be called before controls start to read themselves from HttpServletRequest
Parameters:
template - template object.

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

This method will be called to validate user input.
Parameters:
sValue - user input string
sWord - value of helpword property of the text control
sValidFormat - value of validformat property of the text control
Returns:
Must return true if input is valid or false if not.

All Packages  Class Hierarchy  This Package  Previous  Next  Index