XStream

Ignore fields and class types

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.2.2
  • Component/s: None
  • Labels:
    None
  • JDK version and platform:
    1.5.0_01

Description

It would be very helpful if you could configure XStream to ignore certain fields and certain classes when outputing xml.

For example

public class X {
private int v;
}

public class Y {
private int w;
private int z;
private X x;
}

would generally create something like:

<Y>
<w>0</w>
<z>0</z>
<x>
<v>0</v>
</x>
</Y>

putting in the following:

xstream.ignoreClass(X.class);
xstream.ignoreField(Y.class, "z");

would yield:

<Y>
<w>0</w>
</Y>

Issue Links

Activity

Hide
Joerg Schaible added a comment -

Was implemented in 1.1.3: XStream.omitField()

Show
Joerg Schaible added a comment - Was implemented in 1.1.3: XStream.omitField()
Hide
Joerg Schaible added a comment -

Sorry, my fault. This feature is not fixed, because XSTR-68 was not implemented yet.

Show
Joerg Schaible added a comment - Sorry, my fault. This feature is not fixed, because XSTR-68 was not implemented yet.
Hide
Joerg Schaible added a comment -

2nd try. This time xstream.omitField() should work!

Show
Joerg Schaible added a comment - 2nd try. This time xstream.omitField() should work!

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: