Annotation Type EmailMustHaveSameDomain


  • @Documented
    @Constraint(validatedBy=EmailMustHaveSameDomainValidator.class)
    @Target({TYPE,ANNOTATION_TYPE})
    @Retention(RUNTIME)
    public @interface EmailMustHaveSameDomain
    The annotated bean must contain at least two properties:
    • a field to compare (option field1)
    • another field to compared (option field2)
    • add the error to field1 (option addErrorToField1, default true)
    • add the error to field2 (option addErrorToField2, default true)
    the eMail entry of field1 must have the same domain as the eMail entry of field2.
    Supported types are beans, null elements are considered valid.
    Author:
    Manfred Tremmel
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String field1
      field1 name to compare.
      String field2
      field2 name to compare.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean addErrorToField1
      add error to field1 (default true).
      boolean addErrorToField2
      add error to field2 (default true).
      Class<?>[] groups
      groups to use.
      String message
      localized message.
      Class<? extends javax.validation.Payload>[] payload
      payload whatever.
    • Element Detail

      • field1

        String field1
        field1 name to compare.
        Returns:
        field/path contains first entry
      • field2

        String field2
        field2 name to compare.
        Returns:
        field/path contains second entry
      • message

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

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

        boolean addErrorToField1
        add error to field1 (default true).
        Returns:
        true if error should be added to field1
        Default:
        true
      • addErrorToField2

        boolean addErrorToField2
        add error to field2 (default true).
        Returns:
        true if error should be added to field2
        Default:
        true
      • payload

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