Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-3153

Omit fields configuration patch

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 2.4.0
    • 2.5.0
    • camel-xstream
    • None
    • Patch Available

    Description

      XStream allows to ignore selected fields for particular classes
      (kind of "transient" fields). This feature is descibed here - Tweaking
      XStream output (http://xstream.codehaus.org/manual-tweaking-output.html).

      I needed to use that functionality in the Camel XStream data
      transformation. AbstractXStreamWrapper provides support for aliases
      and implicit collections but doesn't for XStream#omitField.

      At this moment this problem can be handled with custom XStream Spring
      FactoryBean and AbstractXStreamWrapper#setXStream method (just like I
      did). However this solution is quite verbose. I think that if
      AbstractXStreamWrapper supports both aliases and implicit collections
      configuration, it should also supports fields omitting.

      I've created patch for AbstractXStreamWrapper and unit test for it.
      Maybe somebody could submit it to the codebase?

      Attachments

        1. xstream_omit_fields.patch
          3 kB
          Henryk Konsek

        Activity

          People

            davsclaus Claus Ibsen
            hekonsek Henryk Konsek
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: