|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.valjax.AbstractValidator
public abstract class AbstractValidator
Validator that provides some basic validation patterns to use.
Concrete implementations of this class need to follow the contract
stated in the Validator
interface.
Validator
Field Summary | |
---|---|
static Pattern |
NAME_PATTERN_1
Regular Expression that can be used to validate a name |
static Pattern |
NAME_PATTERN_2
Regular Expression that can be used to validate a name. |
static String |
PATTERN_ADDRESS
Regular Expression that can be used to validate an address pattern |
static String |
PATTERN_ALPHA
Regular Expression that can be used to validate alphabetic patterns |
static String |
PATTERN_ALPHANUMERIC
Regular Expression that can be used to validate an alpha numeric patterns |
static String |
PATTERN_CURRENCY
Regular Expression that can be used to validate an currency patterns. |
static String |
PATTERN_DATE
Regular Expression that can be used to validate date patterns. |
static String |
PATTERN_DIGITS
Regular Expression that can be used to validate numeric patterns. |
static String |
PATTERN_FAX
Regular Expression that can be used to validate a phone pattern. |
static String |
PATTERN_MONTH
Regular Expression that can be used to validate the month. |
static String |
PATTERN_MONTH_YEAR
Regular Expression that can be used to validate the month and year. |
static String |
PATTERN_NUMBER
Regular Expression that can be used to validate patterns any number with numeric syntax such as: |
static String |
PATTERN_PHONE
Regular Expression that can be used to validate a phone pattern with additional syntax, such as extension numbers: |
static String |
PATTERN_YEAR
Regular Expression that can be used to validate the year using 4 digits. |
static String |
PATTERN_ZIP
Regular Expression that can be used to validate the zip |
Constructor Summary | |
---|---|
AbstractValidator()
|
Method Summary | |
---|---|
Boolean |
isAddress(String value)
Uses the address regex pattern to access whether this string value is a match |
Boolean |
isAlpha(String value)
Uses the alphabetic regex pattern to access whether this string value is a match |
Boolean |
isAlphaNumeric(String value)
Uses the alpha numeric regex pattern to access whether this string value is a match |
Boolean |
isCurrency(String value)
Uses the alpha numeric regex pattern to access whether this string value is a match |
Boolean |
isDate(String value)
Uses the alpha numeric regex pattern to access whether this string value is a match |
Boolean |
isDigits(String value)
Uses the digits regex pattern to access whether this string value is a match |
Boolean |
isFamilyName(String value)
Uses the name regex pattern to access whether this string value is a match |
Boolean |
isFax(String value)
Uses the fax regex pattern to access whether this string value is a match |
Boolean |
isGivenName(String value)
Uses the name regex pattern to access whether this string value is a match |
Boolean |
isMonth(String value)
Validate month against format mm |
Boolean |
isMonthYear(String value)
Validate month/year against format mm/yyyy |
Boolean |
isNumber(String value)
Uses the phone regex pattern to access whether this string value is a match |
Boolean |
isPhone(String value)
Uses the phone regex pattern to access whether this string value is a match |
Boolean |
isYear(String value)
Uses the year regex pattern to access whether this string value is a match |
Boolean |
isZip(String value)
Uses the zip code regex pattern to access whether this string value is a match |
Boolean |
validateCustom(String value,
String pattern)
Validate a value against your own defined pattern. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.springframework.validation.Validator |
---|
supports, validate |
Field Detail |
---|
public static final String PATTERN_ADDRESS
public static final String PATTERN_ALPHA
public static final String PATTERN_ALPHANUMERIC
public static final String PATTERN_CURRENCY
For example, $12.45
is a valid pattern.
public static final String PATTERN_DATE
mm/dd/yyyy
public static final String PATTERN_DIGITS
This is numeric only and doesn't include additiona syntax.
1,233,434.09
is not allowed.
public static final String PATTERN_FAX
Pattern is without any additional syntax, this is strictly:
123-123-1233
or
1234567890
public static final String PATTERN_MONTH
1-12
or 01-09, 10, 11, 12
public static final String PATTERN_MONTH_YEAR
The month being the first in the pattern.
1-12/2006
or 01-09, 10, 11, 12/2006
public static final String PATTERN_NUMBER
-1,233,434.09
public static final String PATTERN_PHONE
123-123-1233x12345
or
1234567890
public static final String PATTERN_YEAR
2006
public static final String PATTERN_ZIP
Pattern checks for any addtional formats
90404-1234, 90404, 904041234
are allowed
public static final Pattern NAME_PATTERN_2
This may contain charatercs such as, '-', for names like 'Wu-Tang'
public static final Pattern NAME_PATTERN_1
Constructor Detail |
---|
public AbstractValidator()
Method Detail |
---|
public Boolean isFamilyName(String value)
value
- The input to check.
NAME_PATTERN_1
,
NAME_PATTERN_2
public Boolean isGivenName(String value)
value
- The input to check.
NAME_PATTERN_1
,
NAME_PATTERN_2
public Boolean validateCustom(String value, String pattern)
value
- The input to checkpattern
- The pattern to match with
public Boolean isAddress(String value)
value
- The input to check.
PATTERN_ADDRESS
public Boolean isAlpha(String value)
value
- The input to check.
PATTERN_ALPHA
public Boolean isAlphaNumeric(String value)
value
- The input to check.
PATTERN_ALPHANUMERIC
public Boolean isCurrency(String value)
value
- The input to check.
PATTERN_ALPHANUMERIC
public Boolean isDate(String value)
value
- The input to check.
PATTERN_ALPHANUMERIC
public Boolean isDigits(String value)
value
- The input to check.
PATTERN_DIGITS
public Boolean isFax(String value)
value
- The input to check.
PATTERN_FAX
public Boolean isMonth(String value)
value
- The input to check.
PATTERN_MONTH
public Boolean isMonthYear(String value)
value
- The input to check.
PATTERN_MONTH_YEAR
public Boolean isNumber(String value)
Formats: -#####.### -##,###.###
value
- The input to check.
PATTERN_NUMBER
public Boolean isPhone(String value)
value
- The input to check.
PATTERN_PHONE
public Boolean isYear(String value)
value
- The input to check.
PATTERN_YEAR
public Boolean isZip(String value)
value
- The input to check.
PATTERN_ZIP
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |