Class AbstractPhoneNumberValueValidator<V extends Annotation>
java.lang.Object
de.knightsoftnet.validators.shared.impl.AbstractPhoneNumberValueValidator<V>
- Type Parameters:
V- the value type
- All Implemented Interfaces:
jakarta.validation.ConstraintValidator<V,Object>
- Direct Known Subclasses:
PhoneNumberValueValidator
public abstract class AbstractPhoneNumberValueValidator<V extends Annotation>
extends Object
implements jakarta.validation.ConstraintValidator<V,Object>
Check a string if it's a valid PhoneNumber.
- Author:
- Manfred Tremmel
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanallow not standardized but common format (true/false).protected booleanallow din 5008 format (true/false).protected booleanallow E123 format (true/false).protected booleanare lower case country codes allowed (true/false).protected booleanallow microsoft format (true/false).protected booleanallow uri format (true/false).protected Stringfield name of the country code field.protected Stringfield name of the phone number field.protected Stringerror message key.protected PhoneNumberUtilphone number utils to test phone numbers. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidinitialize(V pconstraintAnnotation) initialize the validator.final booleancheck if given string is a valid gln.
-
Field Details
-
message
error message key. -
fieldCountryCode
field name of the country code field. -
fieldPhoneNumber
field name of the phone number field. -
allowLowerCaseCountryCode
protected boolean allowLowerCaseCountryCodeare lower case country codes allowed (true/false). -
allowDin5008
protected boolean allowDin5008allow din 5008 format (true/false). -
allowE123
protected boolean allowE123allow E123 format (true/false). -
allowUri
protected boolean allowUriallow uri format (true/false). -
allowMs
protected boolean allowMsallow microsoft format (true/false). -
allowCommon
protected boolean allowCommonallow not standardized but common format (true/false). -
phoneNumberUtil
phone number utils to test phone numbers.
-
-
Constructor Details
-
AbstractPhoneNumberValueValidator
public AbstractPhoneNumberValueValidator()
-
-
Method Details
-
initialize
initialize the validator.- Specified by:
initializein interfacejakarta.validation.ConstraintValidator<V extends Annotation,Object> - See Also:
-
ConstraintValidator.initialize(java.lang.annotation.Annotation)
-
isValid
check if given string is a valid gln.- Specified by:
isValidin interfacejakarta.validation.ConstraintValidator<V extends Annotation,Object> - See Also:
-
ConstraintValidator.isValid(java.lang.Object, jakarta.validation.ConstraintValidatorContext)
-