com.oopreserch.web
Class AbstractVerifier
java.lang.Object
|
+--com.oopreserch.web.AbstractVerifier
- All Implemented Interfaces:
- FormValueVerifier
- Direct Known Subclasses:
- IsAlphabet, IsAlphabetLower, IsAlphabetUpper, IsBasicLatin, IsDigit, IsDigitOrAlphabet, IsJpFullWidth, IsJpFullWidthKatakana, IsJpHalfWidth, IsJpHalfWidthKatakana, IsJpHiragana, IsJpPostalAddress
- public abstract class AbstractVerifier
- extends java.lang.Object
- implements FormValueVerifier
The abstarct class which implements usefull methods
to be used by its subclass.
Please feel free to implement your own subclass of this
class. Your subclass must implement #isValid(char)
method. Then, isValidString(String) calls
#isValid(char) with each character from the given
String. Only if #isValid(char) returns true
for all these characters, isValidString(String)
returns true.
If you can depend on the regular expression
matching (which is introduced in JDK 1.4), this class
may not be so usefull, because you can implements your
own isValidString(String) easily.
But, if you can't, please take the full advantage of
this class. Within your #isValid(char), you can
call some of the usefull methods of this class.
By this way, you can easily implement
FormValueVerifier interface.
- Author:
- Jun Inamori
|
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. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractVerifier
public AbstractVerifier()
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 member of FormValueVerifier interface.
This method iterates over all the characters in the given
String. For each character, #isValid(char) is
called.
The subclass of this class must implements its own
#isValid(char) method.
Only if #isValid(char) returns true for
all the characters, this method returns true.
- Specified by:
isValidString in interface FormValueVerifier
- Parameters:
str - The String to be inserted into the HTML fragment.- Returns:
- true if the String is valid. Otherwise, false.
- Since:
- 1.4
ALL CONTENTS COPYRIGHT 2002, Jun Inamori. All rights reserved.
Any questions and comments are welcome to Jun Inamori.