org.apache.struts.beanvalidation.constraints

## Annotation Type FieldMatch

-     @Constraint(validatedBy=FieldMatchValidator.class)
       @Documented
       @Target(value={TYPE,ANNOTATION_TYPE})
       @Retention(value=RUNTIME)
      public @interface FieldMatch

  Validation annotation to validate that two fields are equal. An array of fields and their matching confirmation fields can be supplied.

  Example, compare 1 pair of fields:

        @FieldMatch(first = "password", second = "confirmPassword", message = "The password fields must match")

  Example, compare more than 1 pair of fields:

        @FieldMatch.List({
             @FieldMatch(first = "password", second = "confirmPassword", message = "The password fields must match"),
             @FieldMatch(first = "email", second = "confirmEmail", message = "The email fields must match")
       })

- - ### Required Element Summary

    Required Elements
    Modifier and Type | Required Element and Description
    --- | ---
    `String` | `first`
    `String` | `second`

  - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `Class<?>[]` | `groups`
    `String` | `message`
    `Class<? extends javax.validation.Payload>[]` | `payload`

- - ### Element Detail

    - #### first

          public abstract String first

      Returns:
        The first field

  - - #### second

          public abstract String second

      Returns:
        The second field

  - - #### message

          public abstract String message

      Default:
        "Fields are not matching"

  - - #### groups

          public abstract Class<?>[] groups

      Default:
        {}

  - - #### payload

          public abstract Class<? extends javax.validation.Payload>[] payload

      Default:
        {}

Copyright © 2000–2023 Apache Software Foundation. All rights reserved.