Class TelephoneNumberSyntaxChecker

  • All Implemented Interfaces:
    Serializable, SchemaObject

    public final class TelephoneNumberSyntaxChecker
    extends SyntaxChecker
    A SyntaxChecker which verifies that a value is a TelephoneNumber according to ITU recommendation E.123 (which is quite vague ...).

    A valid Telephone number respects more or less this syntax :

     " *[+]? *((\([0-9- ,;/#*]+\))|[0-9- ,;/#*]+)+"
     
    If needed, and to allow more syntaxes, a list of regexps has been added which can be initialized to other values
    Author:
    Apache Directory Project
    See Also:
    Serialized Form
    • Method Detail

      • getRegexp

        public String getRegexp()
        Get the default regexp (either the original one, or the one that has been set)
        Returns:
        The default regexp
      • isValidSyntax

        public boolean isValidSyntax​(Object value)
        Determines if the attribute's value conforms to the attribute syntax.
        Overrides:
        isValidSyntax in class SyntaxChecker
        Parameters:
        value - the value of some attribute with the syntax
        Returns:
        true if the value is in the valid syntax, false otherwise