Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4210

@TypeConversion converter attribut to class

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.12
    • Component/s: Annotations
    • Labels:
      None

      Description

      Can you please change "converter" property type from String to class type.

      @Conversion(conversions = { @TypeConversion(type = ConversionType.CLASS, rule = ConversionRule.PROPERTY, converter = "com.xxx.MyConverter", key = "myKey") })
      

      ---->

      @Conversion(conversions = { @TypeConversion(type = ConversionType.CLASS, rule = ConversionRule.PROPERTY, converter = MyConverter.class, key = "myKey") })
      

        Issue Links

          Activity

          Hide
          lukaszlenart Lukasz Lenart added a comment -

          Nice idea, but it is a breaking change

          Show
          lukaszlenart Lukasz Lenart added a comment - Nice idea, but it is a breaking change
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user lukaszlenart opened a pull request:

          https://github.com/apache/struts/pull/131

          WW-4210: Type conversion class

          This PR extends existing `TypeConversion` annotation to allow define converters as a class instead of a raw string.

          Implements WW-4210(https://issues.apache.org/jira/browse/WW-4210)

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/lukaszlenart/struts type-conversion-class

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/struts/pull/131.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #131


          commit 47552bdb0673a88b0cd76cebc40f65477edd58d0
          Author: Lukasz Lenart <lukaszlenart@apache.org>
          Date: 2017-04-20T06:28:46Z

          WW-4210 Extends annotation to allow use class instead of string

          commit 3e76564d3ce8d5b4a3938efd3a76c521eb045f38
          Author: Lukasz Lenart <lukaszlenart@apache.org>
          Date: 2017-04-20T06:29:24Z

          WW-4210 Supports defining converter as a class in the annotation

          commit ec2412492503cdd0e90abf7f2cf2c3e50c8fa70c
          Author: Lukasz Lenart <lukaszlenart@apache.org>
          Date: 2017-04-20T06:29:53Z

          WW-4210 Updates tests to use the class definition instead of string


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user lukaszlenart opened a pull request: https://github.com/apache/struts/pull/131 WW-4210 : Type conversion class This PR extends existing `TypeConversion` annotation to allow define converters as a class instead of a raw string. Implements WW-4210 ( https://issues.apache.org/jira/browse/WW-4210 ) You can merge this pull request into a Git repository by running: $ git pull https://github.com/lukaszlenart/struts type-conversion-class Alternatively you can review and apply these changes as the patch at: https://github.com/apache/struts/pull/131.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #131 commit 47552bdb0673a88b0cd76cebc40f65477edd58d0 Author: Lukasz Lenart <lukaszlenart@apache.org> Date: 2017-04-20T06:28:46Z WW-4210 Extends annotation to allow use class instead of string commit 3e76564d3ce8d5b4a3938efd3a76c521eb045f38 Author: Lukasz Lenart <lukaszlenart@apache.org> Date: 2017-04-20T06:29:24Z WW-4210 Supports defining converter as a class in the annotation commit ec2412492503cdd0e90abf7f2cf2c3e50c8fa70c Author: Lukasz Lenart <lukaszlenart@apache.org> Date: 2017-04-20T06:29:53Z WW-4210 Updates tests to use the class definition instead of string
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user cnenning commented on the issue:

          https://github.com/apache/struts/pull/131

          👍

          Show
          githubbot ASF GitHub Bot added a comment - Github user cnenning commented on the issue: https://github.com/apache/struts/pull/131 👍
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/struts/pull/131

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/struts/pull/131
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 47552bdb0673a88b0cd76cebc40f65477edd58d0 in struts's branch refs/heads/master from Lukasz Lenart
          [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=47552bd ]

          WW-4210 Extends annotation to allow use class instead of string

          Show
          jira-bot ASF subversion and git services added a comment - Commit 47552bdb0673a88b0cd76cebc40f65477edd58d0 in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=47552bd ] WW-4210 Extends annotation to allow use class instead of string
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 3e76564d3ce8d5b4a3938efd3a76c521eb045f38 in struts's branch refs/heads/master from Lukasz Lenart
          [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=3e76564 ]

          WW-4210 Supports defining converter as a class in the annotation

          Show
          jira-bot ASF subversion and git services added a comment - Commit 3e76564d3ce8d5b4a3938efd3a76c521eb045f38 in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=3e76564 ] WW-4210 Supports defining converter as a class in the annotation
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit ec2412492503cdd0e90abf7f2cf2c3e50c8fa70c in struts's branch refs/heads/master from Lukasz Lenart
          [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=ec24124 ]

          WW-4210 Updates tests to use the class definition instead of string

          Show
          jira-bot ASF subversion and git services added a comment - Commit ec2412492503cdd0e90abf7f2cf2c3e50c8fa70c in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=ec24124 ] WW-4210 Updates tests to use the class definition instead of string
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit a58452571c90314f8ed56301133a2a7f7ad1c67b in struts's branch refs/heads/master from Lukasz Lenart
          [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=a584525 ]

          WW-4210 Updates JavaDocs

          Show
          jira-bot ASF subversion and git services added a comment - Commit a58452571c90314f8ed56301133a2a7f7ad1c67b in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=a584525 ] WW-4210 Updates JavaDocs
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit faf72b5a09ad8312a90b564971e6d679bbeda6cf in struts's branch refs/heads/master from Lukasz Lenart
          [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=faf72b5 ]

          WW-4210 Adds support for defining converter via class instead of string

          Show
          jira-bot ASF subversion and git services added a comment - Commit faf72b5a09ad8312a90b564971e6d679bbeda6cf in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=faf72b5 ] WW-4210 Adds support for defining converter via class instead of string
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build Struts-JDK7-master #622 (See https://builds.apache.org/job/Struts-JDK7-master/622/)
          WW-4210 Extends annotation to allow use class instead of string (lukaszlenart: rev 47552bdb0673a88b0cd76cebc40f65477edd58d0)

          • (edit) core/src/main/java/com/opensymphony/xwork2/conversion/annotations/TypeConversion.java
            WW-4210 Supports defining converter as a class in the annotation (lukaszlenart: rev 3e76564d3ce8d5b4a3938efd3a76c521eb045f38)
          • (edit) core/src/main/java/com/opensymphony/xwork2/conversion/impl/DefaultTypeConverterCreator.java
          • (edit) core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkConverter.java
          • (edit) core/src/main/java/com/opensymphony/xwork2/conversion/TypeConverterCreator.java
          • (edit) core/src/main/java/com/opensymphony/xwork2/conversion/impl/DefaultConversionAnnotationProcessor.java
            WW-4210 Updates tests to use the class definition instead of string (lukaszlenart: rev ec2412492503cdd0e90abf7f2cf2c3e50c8fa70c)
          • (edit) core/src/test/java/com/opensymphony/xwork2/test/AnnotationDataAware.java
          • (edit) core/src/test/java/com/opensymphony/xwork2/conversion/ConversionTestAction.java
          • (edit) core/src/test/java/com/opensymphony/xwork2/test/AnnotationUser.java
          • (edit) core/src/test/java/com/opensymphony/xwork2/test/AnnotationTestBean2.java
          • (edit) core/src/test/java/com/opensymphony/xwork2/test/annotations/PersonAction.java
          • (edit) core/src/test/java/com/opensymphony/xwork2/util/AnnotatedCat.java
            WW-4210 Updates JavaDocs (lukaszlenart: rev a58452571c90314f8ed56301133a2a7f7ad1c67b)
          • (edit) core/src/main/java/com/opensymphony/xwork2/conversion/annotations/TypeConversion.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Struts-JDK7-master #622 (See https://builds.apache.org/job/Struts-JDK7-master/622/ ) WW-4210 Extends annotation to allow use class instead of string (lukaszlenart: rev 47552bdb0673a88b0cd76cebc40f65477edd58d0) (edit) core/src/main/java/com/opensymphony/xwork2/conversion/annotations/TypeConversion.java WW-4210 Supports defining converter as a class in the annotation (lukaszlenart: rev 3e76564d3ce8d5b4a3938efd3a76c521eb045f38) (edit) core/src/main/java/com/opensymphony/xwork2/conversion/impl/DefaultTypeConverterCreator.java (edit) core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkConverter.java (edit) core/src/main/java/com/opensymphony/xwork2/conversion/TypeConverterCreator.java (edit) core/src/main/java/com/opensymphony/xwork2/conversion/impl/DefaultConversionAnnotationProcessor.java WW-4210 Updates tests to use the class definition instead of string (lukaszlenart: rev ec2412492503cdd0e90abf7f2cf2c3e50c8fa70c) (edit) core/src/test/java/com/opensymphony/xwork2/test/AnnotationDataAware.java (edit) core/src/test/java/com/opensymphony/xwork2/conversion/ConversionTestAction.java (edit) core/src/test/java/com/opensymphony/xwork2/test/AnnotationUser.java (edit) core/src/test/java/com/opensymphony/xwork2/test/AnnotationTestBean2.java (edit) core/src/test/java/com/opensymphony/xwork2/test/annotations/PersonAction.java (edit) core/src/test/java/com/opensymphony/xwork2/util/AnnotatedCat.java WW-4210 Updates JavaDocs (lukaszlenart: rev a58452571c90314f8ed56301133a2a7f7ad1c67b) (edit) core/src/main/java/com/opensymphony/xwork2/conversion/annotations/TypeConversion.java
          Hide
          lukaszlenart Lukasz Lenart added a comment -

          PR got merged

          Show
          lukaszlenart Lukasz Lenart added a comment - PR got merged

            People

            • Assignee:
              lukaszlenart Lukasz Lenart
              Reporter:
              jflefebvre lefebvre
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development