XStream
  1. XStream
  2. XSTR-278

field level converter overriding using annotations

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      None
    • JDK version and platform:
      1.5

      Description

      Allow converter overriding in a field-basis and not class-level... (using annotations).

      The patch I have created has the following issues that I did not know what you would like:

      1. There is a try/catch during initialization (PureJavaReflectionProvider) that starts the AnnotationProvider.... what to do if an exception is caught? (ClassNotFoundException)
      2. JavaAnnotationsReflectionProvider has the same problem with exception dealing (did not know how you would like to do it)

      A few acceptance tests were included. I tested it compiling in jdk1.5, running the ant build.
      The generated jar file was tested under java 1.5 and 1.4 successfuly.

      1. patch.txt
        40 kB
        Mauro Talevi
      2. patch.txt
        33 kB
        Guilherme Silveira

        Activity

        Hide
        Guilherme Silveira added a comment -

        new patch with created files

        Show
        Guilherme Silveira added a comment - new patch with created files
        Hide
        Mauro Talevi added a comment -

        Uploaded new patch from Guilherme

        Show
        Mauro Talevi added a comment - Uploaded new patch from Guilherme
        Hide
        Mauro Talevi added a comment -

        Guilherme - applied your latest patch with some minor modifications (some class and method renames).
        Also merged the acceptance tests into a single one. Thanks for great work!

        Show
        Mauro Talevi added a comment - Guilherme - applied your latest patch with some minor modifications (some class and method renames). Also merged the acceptance tests into a single one. Thanks for great work!
        Hide
        Jörg Schaible added a comment -

        Hi Guilherme,

        thanks for this enhancement. Please have a look, if the current version in the repe works for you, since I applied my changed for the ReflectionConverter refactoring and I had to move around some things. I also dropped the JVM.bestReflectionConverter completely (and that impl made XStream incompatible with a pre JDK 1.5). If anything works for you, please close this issue. All unit tests pass though.

        • Jörg
        Show
        Jörg Schaible added a comment - Hi Guilherme, thanks for this enhancement. Please have a look, if the current version in the repe works for you, since I applied my changed for the ReflectionConverter refactoring and I had to move around some things. I also dropped the JVM.bestReflectionConverter completely (and that impl made XStream incompatible with a pre JDK 1.5). If anything works for you, please close this issue. All unit tests pass though. Jörg

          People

          • Assignee:
            Unassigned
            Reporter:
            Guilherme Silveira
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: