|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfc.web.simpleforms.Valid
public final class Valid
Utility methods for common validation needs.
Constructor Summary | |
---|---|
Valid()
|
Method Summary | |
---|---|
static boolean |
isAllowed(String str,
String allowedChars)
Returns true if the specified string only contains the allowed characters. |
static boolean |
isEmpty(String str)
|
static boolean |
isFloatOnly(String str)
Ensures that the string is composed of only floating point numbers (digits [0-9] and maybe a "."), with optional leading/trailing blanks. |
static boolean |
isIntegerOnly(String str)
Ensures that the string is composed of only an digits [0-9] with optional leading/trailing blanks. |
static boolean |
isNotAllowed(String str,
String unallowedChars)
Returns true if the specified string has no unallowed characters. |
static boolean |
isNotEmpty(String str)
Returns true is the specified string is not null and not empty (""). |
static boolean |
length(String str,
int min,
int max)
Returns true if the string is non-empty and it's length is between the specified min and max lengths (both inclusive). |
static void |
main(String[] args)
|
static void |
setTrimSpaces(boolean val)
If set to true, methods in this class will trim the string entered by the user before attempting to run further validation on it, else strings will not be trimmed automatically. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Valid()
Method Detail |
---|
public static void setTrimSpaces(boolean val)
public static boolean isIntegerOnly(String str)
public static boolean isFloatOnly(String str)
public static boolean isEmpty(String str)
public static boolean isNotEmpty(String str)
public static boolean length(String str, int min, int max)
public static boolean isAllowed(String str, String allowedChars)
public static boolean isNotAllowed(String str, String unallowedChars)
public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |