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 Details

    • 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 Details

    • AbstractPhoneNumberValueValidator

      public AbstractPhoneNumberValueValidator()
  • Method Details

    • initialize

      public abstract void initialize(V pconstraintAnnotation)
      initialize the validator.
      Specified by:
      initialize in interface jakarta.validation.ConstraintValidator<V extends Annotation,Object>
      See Also:
      • ConstraintValidator.initialize(java.lang.annotation.Annotation)
    • isValid

      public final boolean isValid(Object pvalue, jakarta.validation.ConstraintValidatorContext pcontext)
      check if given string is a valid gln.
      Specified by:
      isValid in interface jakarta.validation.ConstraintValidator<V extends Annotation,Object>
      See Also:
      • ConstraintValidator.isValid(java.lang.Object, jakarta.validation.ConstraintValidatorContext)