History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XSTR-210
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Matthew Inger
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XStream

Ignore fields and class types

Created: 29/Mar/05 12:30 PM   Updated: 24/May/07 12:38 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.2

Issue Links:
Related
 

JDK version and platform: 1.5.0_01


 Description  « Hide
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>


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Joerg Schaible - 15/Feb/06 08:29 PM
Was implemented in 1.1.3: XStream.omitField()

Joerg Schaible - 18/Aug/06 01:22 AM
Sorry, my fault. This feature is not fixed, because XSTR-68 was not implemented yet.

Joerg Schaible - 21/May/07 05:27 PM
2nd try. This time xstream.omitField() should work!