Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5470

Remove 'final' from org.apache.wicket.markup.html.form.EnumChoiceRenderer#getDisplayValue

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 6.13.0
    • 6.14.0, 7.0.0-M1
    • wicket
    • None

    Description

      org.apache.wicket.markup.html.form.EnumChoiceRenderer#getDisplayValue() adds unnecessary indirection by providing overrideable #postprocess() method.

      If an application doesn't want to use the default implementation to resolve a display value by using i18n resources then it should provide its own custom implementation of IChoiceRenderer because org.apache.wicket.markup.html.form.EnumChoiceRenderer#getDisplayValue is final and it will throw MissingResourceException.

      If an application needs to use different logic it should be able to override #getDisplayValue(). If it needs to do something like #postprocess() then it can do:

      public Object getDisplayValue() {
      Object orig = super.getDisplayValue();
      return manipulate(orig);
      }

      Attachments

        Issue Links

          Activity

            People

              mgrigorov Martin Tzvetanov Grigorov
              mgrigorov Martin Tzvetanov Grigorov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: