Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-825

Automatically convert String method arguments to Enum when possible

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 1.7
    • Fix Version/s: 2.0
    • Component/s: Engine
    • Labels:
      None

      Description

      Would be nice if

      $obj.someMethod('VALUE')

      would call

      obj.someMethod(SomeEnum.VALUE);

      when obj has #someMethod(SomeEnum). In other words, if no method is found for the provided arguments then see if some of the String arguments can be replaced with Enum constants.

        Activity

        Hide
        claude Claude Brisson added a comment -

        The default Uberspector now performs the String -> Enum constant conversion when necessary.

        Show
        claude Claude Brisson added a comment - The default Uberspector now performs the String -> Enum constant conversion when necessary.
        Show
        mflorea Marius Dumitru Florea added a comment - I'm using https://github.com/xwiki/xwiki-commons/blob/master/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/introspection/EnumMethodParameterUberspector.java in the mean time.

          People

          • Assignee:
            claude Claude Brisson
            Reporter:
            mflorea Marius Dumitru Florea
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development