Class AbstractPhoneNumberValueValidator<V extends Annotation>

  • 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 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.
    • Constructor Detail

      • AbstractPhoneNumberValueValidator

        public AbstractPhoneNumberValueValidator()
    • Method Detail

      • initialize

        public abstract void initialize​(V pconstraintAnnotation)
        initialize the validator.
        Specified by:
        initialize in interface javax.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:
        isValid in interface javax.validation.ConstraintValidator<V extends Annotation,​Object>
        See Also:
        ConstraintValidator.isValid(java.lang.Object, javax.validation.ConstraintValidatorContext)