Uploaded image for project: 'Hibernate Validator'
  1. Hibernate Validator
  2. HV-308

Annotation processor should consider validators registered by XML constraint mapping

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: annotation-processor
    • Labels:
      None
    • Last commented by a user?:
      true
    • Suitable for new contributors:
      Yes, likely

      Description

      Background:
      The Bean Validation API allows the set of validators for a given constraint to be specified/overridden using XML constraint mapping files (http://docs.jboss.org/hibernate/stable/validator/reference/en/html_single/#d0e1957).

      Right now the annotation processor does not process any XML configuration files at all (neither validation.xml nor mapping files).

      To do:
      While it seems ok for now that the AP does not check constraint declarations given in XML (after all it's an annotation processor), I think it should evaluate the constraint definitions and the validators configured in XML. Otherwise the AP would raise false errors (as validators added in XML are ignored) or would give false positives (as validators given in @Constraint#validatedBy could be removed by "include-existing-validator='false'").

        Attachments

          Activity

          Hide
          hardy.ferentschik Hardy Ferentschik added a comment -

          Do you have any plans for implementing this?

          Show
          hardy.ferentschik Hardy Ferentschik added a comment - Do you have any plans for implementing this?
          Hide
          gunnar.morling Gunnar Morling added a comment -

          No, not really at this point. Do you think, we should do it for 4.2? Another issue in this context is HV-418, at least this one should ship with 4.2

          Show
          gunnar.morling Gunnar Morling added a comment - No, not really at this point. Do you think, we should do it for 4.2? Another issue in this context is HV-418 , at least this one should ship with 4.2
          Hide
          hardy.ferentschik Hardy Ferentschik added a comment -

          It would be nice if we could get it into 4.2, but not essential imo. HV-418 seems more important and hopefully not so hard to fix.
          I move it into the 4.2.0 final release. If we don't have time for it we move it out later.

          Show
          hardy.ferentschik Hardy Ferentschik added a comment - It would be nice if we could get it into 4.2, but not essential imo. HV-418 seems more important and hopefully not so hard to fix. I move it into the 4.2.0 final release. If we don't have time for it we move it out later.
          Hide
          gunnar.morling Gunnar Morling added a comment -

          Ok, let's start with HV-418. Another story is checking method level constraints with the AP, I'll create another JIRA issue for this, but this definitely can be done in 4.3

          Show
          gunnar.morling Gunnar Morling added a comment - Ok, let's start with HV-418 . Another story is checking method level constraints with the AP, I'll create another JIRA issue for this, but this definitely can be done in 4.3

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: