com.oopreserch.web
Class AbstractVerifierByRegEx
java.lang.Object
|
+--com.oopreserch.web.AbstractVerifierByRegEx
- All Implemented Interfaces:
- FormValueVerifier
- Direct Known Subclasses:
- IsEmailAddress, IsJpPostalCode, IsTelephone
- public abstract class AbstractVerifierByRegEx
- extends java.lang.Object
- implements FormValueVerifier
The base class for FormValueVerifier implementations,
which use java.util.regex package.
Each sub-classes of this abstract class must implement
init( ) method, which specifies the regular
expression for that class.
For example, init( ) method of
IsJpPostalCode looks like this:
public void init(){
REGEX="[0-9]{3}(\\-)[0-9]{4}";
}
- Author:
- Jun Inamori
|
Method Summary |
boolean |
isValidString(java.lang.String str)
Returns true if the given String matches with the
specific regular expression. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractVerifierByRegEx
public AbstractVerifierByRegEx()
- Constructor.
isValidString
public boolean isValidString(java.lang.String str)
- Returns true if the given String matches with the
specific regular expression.
Within init( ) method,
each sub-class must specify the regular expression for that
class.
- Specified by:
isValidString in interface FormValueVerifier
- Parameters:
str - String to be tested.
- Returns:
- true if the given String matches with the
specific regular expression.
ALL CONTENTS COPYRIGHT 2002, Jun Inamori. All rights reserved.
Any questions and comments are welcome to Jun Inamori.