Annotation Type PhoneNumber


  • @Documented
    @Constraint(validatedBy=PhoneNumberValidator.class)
    @Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER})
    @Retention(RUNTIME)
    public @interface PhoneNumber
    The annotated element must be a valid phone number format.
    Supported types are Strings, other Objects are transfered to Strings, null elements are considered valid. Different formats can be turned on/off with allowDin5008, allowE123, allowUri, allowMs and allowCommon. By default all formats are turned on, you can turn it off with false.
    There are numeric, size and checksum tests by apache commons validation routines.
    Author:
    Manfred Tremmel
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean allowCommon
      allow not standardized but common format (true/false).
      boolean allowDin5008
      allow din 5008 format (true/false).
      boolean allowE123
      allow E123 format (true/false).
      boolean allowMs
      allow microsoft format (true/false).
      boolean allowUri
      allow uri format (true/false).
      Class<?>[] groups
      groups to use.
      String message
      localized message.
      Class<? extends javax.validation.Payload>[] payload
      payload whatever.
    • Element Detail

      • message

        String message
        localized message.
        Returns:
        localized validation message
        Default:
        "{de.knightsoftnet.validators.shared.PhoneNumber.message}"
      • groups

        Class<?>[] groups
        groups to use.
        Returns:
        array of validation groups
        Default:
        {}
      • payload

        Class<? extends javax.validation.Payload>[] payload
        payload whatever.
        Returns:
        payload class
        Default:
        {}
      • allowDin5008

        boolean allowDin5008
        allow din 5008 format (true/false).
        Returns:
        true if din 5008 format is allowed
        Default:
        true
      • allowE123

        boolean allowE123
        allow E123 format (true/false).
        Returns:
        true if e123 format is allowed
        Default:
        true
      • allowUri

        boolean allowUri
        allow uri format (true/false).
        Returns:
        true if uri format is allowed
        Default:
        true
      • allowMs

        boolean allowMs
        allow microsoft format (true/false).
        Returns:
        true if ms format is allowed
        Default:
        true
      • allowCommon

        boolean allowCommon
        allow not standardized but common format (true/false).
        Returns:
        true if common format is allowed
        Default:
        true