Class Valid
java.lang.Object
fc.web.simpleforms.Valid
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturns true if the specified string only contains the allowed characters.static booleanstatic booleanisFloatOnly(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 booleanisIntegerOnly(String str) Ensures that the string is composed of only an digits [0-9] with optional leading/trailing blanks.static booleanisNotAllowed(String str, String unallowedChars) Returns true if the specified string has no unallowed characters.static booleanisNotEmpty(String str) Returns true is the specified string is not null and not empty ("").static booleanReturns true if the string is non-empty and it's length is between the specified min and max lengths (both inclusive).static voidstatic voidsetTrimSpaces(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.
-
Constructor Details
-
Valid
public Valid()
-
-
Method Details
-
setTrimSpaces
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. Defaults to true. -
isIntegerOnly
Ensures that the string is composed of only an digits [0-9] with optional leading/trailing blanks. (floating point/real numbers are not allowed because they contain a ".") -
isFloatOnly
Ensures that the string is composed of only floating point numbers (digits [0-9] and maybe a "."), with optional leading/trailing blanks. Negative numbers (with a leading "-") are also allowed. -
isEmpty
-
isNotEmpty
Returns true is the specified string is not null and not empty (""). -
length
-
isAllowed
-
isNotAllowed
Returns true if the specified string has no unallowed characters. If the string contains any unallowed characters, returns false -
main
-