I need to write few class which are to be used to validate the data.

I know some validations which we will use generally.

if anybody knows more please help me by providing the list of some more validations.


The validations which I know are as follows:

String:

length
isAlpha
isAlphaNumeric
isLower
isUpper
isNull


Numeric
isNumber
lengthOfDigits
isPositive
isNegative
isInt
isFraction
lessThan
greaterThan
equals
isInRange

Date
isValidDate
isLessthan
isGreaterthan
isequalto


General

email
postalcode
telephoneNumber

Recommended Answers

All 4 Replies

Thanks in advance for your usefull reply.

I would suggest to continue with the application and implement whatever validation you require as you progress.

Postcodes and telephone numbers need to be localised.
Date: is WorkingDay / isHoliday (also localised).
Credit card number check digit.

Are all these going to extend an abstract Validation class, or implement a Validation interface? What will the calling protocol look like? Will you use a return code or an Exception for errors?

Will you provide higher-level convenience methods such as: check a String against a list of validations and display default error messages if it fails?

Keep us updated on this project - it looks really interesting and potentially VERY useful. Good luck.

Also look into Commons Validator. Though it doesn't have a large tutorial collection or user base, there would certainly be a few things out there which you might find interesting.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.