Annotation Type 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
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Defines several @PhoneNumber annotations on the same element.
  • Optional Element Summary

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

    • 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 jakarta.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