Wicket
  1. Wicket
  2. WICKET-4234

Remove AbstractValidator because its mostly noise

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0.0-beta1
    • Component/s: None
    • Labels:
      None

      Description

      with the introduction of ValidationError, AbstractValidator has been mostly superseded because ValidationError makes it trivial to construct errors and let subclasses tweak them.

      this issue is to track the progress of removal of AbstractValidator

        Issue Links

          Activity

          Hide
          Emond Papegaaij added a comment -

          It would be nice if the RangeValidators got meaningful static factory methods. Instantiating the validators with null-arguments really isn't intuitive and makes the code hard to understand. This patch introduces a few for StringValidator, I can create patches for the others as well if you want me to.

          Show
          Emond Papegaaij added a comment - It would be nice if the RangeValidators got meaningful static factory methods. Instantiating the validators with null-arguments really isn't intuitive and makes the code hard to understand. This patch introduces a few for StringValidator, I can create patches for the others as well if you want me to.
          Hide
          Martin Grigorov added a comment -

          reopening by request from Emond.

          Show
          Martin Grigorov added a comment - reopening by request from Emond.
          Hide
          Emond Papegaaij added a comment -

          This patch adds util methods to StringValidator, RangeValidator and DateValidators. Most of these methods are the same as in Wicket 1.5 (but on top of the new API), which should make it a lot easier to port from Wicket 1.5 to 6.0.

          Show
          Emond Papegaaij added a comment - This patch adds util methods to StringValidator, RangeValidator and DateValidators. Most of these methods are the same as in Wicket 1.5 (but on top of the new API), which should make it a lot easier to port from Wicket 1.5 to 6.0.
          Hide
          Igor Vaynberg added a comment -

          patch applied, thanks

          Show
          Igor Vaynberg added a comment - patch applied, thanks
          Hide
          Martin Grigorov added a comment -

          The migration docs for this change are really poor.
          I'm wasting time and nerves trying to migrate some code. Poor users ...

          Show
          Martin Grigorov added a comment - The migration docs for this change are really poor. I'm wasting time and nerves trying to migrate some code. Poor users ...
          Hide
          Martin Grigorov added a comment -

          Can we have back INullAcceptingValidator#validateOnNullValue() ?
          Before it was possible to create a validator that either accepts a configuration parameter or decides this dynamically.

          Show
          Martin Grigorov added a comment - Can we have back INullAcceptingValidator#validateOnNullValue() ? Before it was possible to create a validator that either accepts a configuration parameter or decides this dynamically.
          Hide
          Peter Ertl added a comment -

          why not

          /**

          • @deprecated use bla blaaah ...
            */
            @Deprecated
            public abstract class AbstractValidator extends Behavior { ... }

          ?

          Show
          Peter Ertl added a comment - why not /** @deprecated use bla blaaah ... */ @Deprecated public abstract class AbstractValidator extends Behavior { ... } ?
          Hide
          Martin Grigorov added a comment -

          Yes, this sounds good too if there is a way to delegate the old methods to the new impl.
          AbstractValidator is not deprecated in 1.5.x either. It is just removed in 6.0. This is good too but the migration docs don't explain what to do now

          Show
          Martin Grigorov added a comment - Yes, this sounds good too if there is a way to delegate the old methods to the new impl. AbstractValidator is not deprecated in 1.5.x either. It is just removed in 6.0. This is good too but the migration docs don't explain what to do now
          Hide
          Emond Papegaaij added a comment -

          No need to keep extending Behavior. I think it should be:
          public abstract class AbstractValidator implements IValidator

          {...}

          Migrating from a deprecated api to a new api is much easier than migrating from a removed API to a new API. The implementation of the deprecated API can contain hints on how to solve the problems, so +1 for me on reintroducing a deprecated AbstractValidator.

          Show
          Emond Papegaaij added a comment - No need to keep extending Behavior. I think it should be: public abstract class AbstractValidator implements IValidator {...} Migrating from a deprecated api to a new api is much easier than migrating from a removed API to a new API. The implementation of the deprecated API can contain hints on how to solve the problems, so +1 for me on reintroducing a deprecated AbstractValidator.
          Hide
          Martin Grigorov added a comment -

          Port the fix for WICKET-4379 once we have agreement how to proceed here.

          Show
          Martin Grigorov added a comment - Port the fix for WICKET-4379 once we have agreement how to proceed here.
          Hide
          Igor Vaynberg added a comment -

          reintroduced AbstractValidator and deprecated it

          Show
          Igor Vaynberg added a comment - reintroduced AbstractValidator and deprecated it

            People

            • Assignee:
              Igor Vaynberg
              Reporter:
              Igor Vaynberg
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development