Class AbstractPhoneNumberValueValidator<V extends Annotation>
- java.lang.Object
-
- de.knightsoftnet.validators.shared.impl.AbstractPhoneNumberValueValidator<V>
-
- Type Parameters:
V- the value type
- All Implemented Interfaces:
javax.validation.ConstraintValidator<V,Object>
- Direct Known Subclasses:
PhoneNumberValueValidator
public abstract class AbstractPhoneNumberValueValidator<V extends Annotation> extends Object implements javax.validation.ConstraintValidator<V,Object>
Check a string if it's a valid PhoneNumber.- Author:
- Manfred Tremmel
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanallowCommonallow not standardized but common format (true/false).protected booleanallowDin5008allow din 5008 format (true/false).protected booleanallowE123allow E123 format (true/false).protected booleanallowLowerCaseCountryCodeare lower case country codes allowed (true/false).protected booleanallowMsallow microsoft format (true/false).protected booleanallowUriallow uri format (true/false).protected StringfieldCountryCodefield name of the country code field.protected StringfieldPhoneNumberfield name of the phone number field.protected Stringmessageerror message key.protected PhoneNumberUtilphoneNumberUtilphone number utils to test phone numbers.
-
Constructor Summary
Constructors Constructor Description AbstractPhoneNumberValueValidator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidinitialize(V pconstraintAnnotation)initialize the validator.booleanisValid(Object pvalue, javax.validation.ConstraintValidatorContext pcontext)check if given string is a valid gln.
-
-
-
Field Detail
-
message
protected String message
error message key.
-
fieldCountryCode
protected String fieldCountryCode
field name of the country code field.
-
fieldPhoneNumber
protected String fieldPhoneNumber
field name of the phone number field.
-
allowLowerCaseCountryCode
protected boolean allowLowerCaseCountryCode
are lower case country codes allowed (true/false).
-
allowDin5008
protected boolean allowDin5008
allow din 5008 format (true/false).
-
allowE123
protected boolean allowE123
allow E123 format (true/false).
-
allowUri
protected boolean allowUri
allow uri format (true/false).
-
allowMs
protected boolean allowMs
allow microsoft format (true/false).
-
allowCommon
protected boolean allowCommon
allow not standardized but common format (true/false).
-
phoneNumberUtil
protected PhoneNumberUtil phoneNumberUtil
phone number utils to test phone numbers.
-
-
Method Detail
-
initialize
public abstract void initialize(V pconstraintAnnotation)
initialize the validator.- Specified by:
initializein interfacejavax.validation.ConstraintValidator<V extends Annotation,Object>- See Also:
ConstraintValidator.initialize(java.lang.annotation.Annotation)
-
isValid
public final boolean isValid(Object pvalue, javax.validation.ConstraintValidatorContext pcontext)
check if given string is a valid gln.- Specified by:
isValidin interfacejavax.validation.ConstraintValidator<V extends Annotation,Object>- See Also:
ConstraintValidator.isValid(java.lang.Object, javax.validation.ConstraintValidatorContext)
-
-