Class Valid
java.lang.Object
fc.web.simpleforms.Valid
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturnstrueif 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) Returnstrueif the specified string has no unallowed characters.static booleanisNotEmpty(String str) Returnstrueis the specified string is notnulland 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 totrue, 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 totrue, 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 totrue. -
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
Returnstrueis the specified string is notnulland not empty (""). -
length
-
isAllowed
-
isNotAllowed
Returnstrueif the specified string has no unallowed characters. If the string contains any unallowed characters, returnsfalse -
main
-