OOP FormGenerator Version 2.1

com.oopreserch.web
Interface FormValueVerifier

All Known Implementing Classes:
AbstractVerifier, AcceptAny, IsEmailAddress, IsDouble, IsTelephone, IsJpPostalCode, IsInteger

public interface FormValueVerifier

The interface for checking the validity of the given String.

Assuming that you request the users to type their age into one of the text field in your CGI FORM. The destination Servlet/JSP should accept the String only with digits (0-9). In case that the users types something like "abc", the input should be treated as invalid. And your Servlet/JSP should request the users to re-enter the correct input.

The implementation of this interface will be used by the instance of Form to check the validity of the String to be inserted. The list of the available implementations should be listed in:

where the value of each property is the fully qualified class name of the implementation of this interface. The key in this property resource file can be specified as the value of verify.type attribute of d.value element in the XML. Then, the corresponding implementation will be used to check the validity of the String inserted.

For your convenience, some useful implementations are included in this package. They are already listed on in the distribution of this API. So, please feel free to use any of them.

Anyway, you can define your own implementation which satisfies your requirement. The implementation of this interface must implement:
If you can use: package introduced in JDK 1.4, you can easily define your own implementation of this interface.

Otherwise, please extend: which implements many usefull methods for your implementation. For details, please visit Introduction of FormGenerator, which shows how to implement this interface.

Since:
1.4
Author:
Jun Inamori

See Also:



Method Summary
 boolean isValidString(java.lang.String str)
          This method will be used by Form to check the validity of the String to be inserted.
 

Method Detail

isValidString

public boolean isValidString(java.lang.String str)
This method will be used by Form to check the validity of the String to be inserted.

The implementation of this method is responsible for checking the validity of the given String. This method must be Thread Safe in all the implementations.
Parameters:
str - The String to be inserted.
Returns:
true if the String is valid. Otherwise, false.
Since:
1.4

OOP FormGenerator Version 2.1

ALL CONTENTS COPYRIGHT 2002, Jun Inamori. All rights reserved.
Any questions and comments are welcome to Jun Inamori.