<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-12137</id>
	<title>Nabble - codehaus - XStream</title>
	<updated>2009-12-01T00:58:15Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/codehaus---XStream-f12137.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/codehaus---XStream-f12137.html" />
	<subtitle type="html">XStream is a simple library to serialize objects to XML and back again. codehaus - XStream home is &lt;a href=&quot;http://xstream.codehaus.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.</subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26588630</id>
	<title>Re: Re: serialize a specific fields determined at runtime</title>
	<published>2009-12-01T00:58:15Z</published>
	<updated>2009-12-01T00:58:15Z</updated>
	<author>
		<name>Jörg Schaible-2</name>
	</author>
	<content type="html">Hi ahmad,
&lt;br&gt;&lt;br&gt;ahmad wrote at Montag, 30. November 2009 00:42:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Thanks Jörg for your reply
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; i have configured XStream with the following, and still not getting the
&lt;br&gt;&amp;gt; required behavior:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; public class FieldSelectors extends MapperWrapper {
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; public FieldSelectors(Mapper wrapped) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super(wrapped);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; @Override
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; public boolean shouldSerializeMember(Class definedIn, String
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; fieldName)
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (definedIn == Person.class &amp; fieldName.equals(&amp;quot;firstName&amp;quot;)) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return true;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return super.shouldSerializeMember(definedIn, fieldName);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; XStream xstream = new XStream() {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; protected MapperWrapper wrapMapper(MapperWrapper next) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return new FieldSelectors(next);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FieldSelectors myMapper = (FieldSelectors) xstream.getMapper()
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .lookupMapperOfType(FieldSelectors.class);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myMapper.shouldSerializeMember(Person.class, &amp;quot;firstName&amp;quot;);
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Waiting your comments on this
&lt;/div&gt;&lt;br&gt;My answer to the exactly same question is still exactly the same:
&lt;br&gt;&lt;br&gt;[snip]
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; This should work for serialization, but it does not work for
&lt;br&gt;&amp;gt;&amp;gt; deserialization. The method is currently not called at deserialization
&lt;br&gt;&amp;gt;&amp;gt; time if the member actually exists. This is actually an enhancement
&lt;br&gt;&amp;gt;&amp;gt; request (XSTR-592). See my answer to your other mail for a solution at
&lt;br&gt;&amp;gt;&amp;gt; deserialization time.
&lt;br&gt;&lt;br&gt;Read my answer to your question in thread &amp;quot;Serialize specific fields&amp;quot;.
&lt;br&gt;&lt;br&gt;- Jörg
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-serialize-a-specific-fields-determined-at-runtime-tp26509675p26588630.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26588566</id>
	<title>Re: omitField method cascade to all objects of the class type passed</title>
	<published>2009-12-01T00:56:23Z</published>
	<updated>2009-12-01T00:56:23Z</updated>
	<author>
		<name>Jörg Schaible-2</name>
	</author>
	<content type="html">Hi ahmad,
&lt;br&gt;&lt;br&gt;ahmad wrote at Sonntag, 29. November 2009 21:10:
&lt;br&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I have a Person Entity, and i want to omit some fields in this object,
&lt;br&gt;&amp;gt; while serialize all field in the other Person object, how this scenario is
&lt;br&gt;&amp;gt; handled in XStream?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks in advance for your help
&lt;br&gt;&lt;br&gt;Which of the solutions I proposed to you in your question of the thread 
&lt;br&gt;&amp;quot;Serialize specific fields&amp;quot; does not work for you?
&lt;br&gt;&lt;br&gt;- Jörg
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/omitField-method-cascade-to-all-objects-of-the-class-type-passed-tp26565532p26588566.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26588481</id>
	<title>Re: phantom element in JSON deserialization</title>
	<published>2009-12-01T00:53:11Z</published>
	<updated>2009-12-01T00:53:11Z</updated>
	<author>
		<name>Jörg Schaible-2</name>
	</author>
	<content type="html">Hi Neil,
&lt;br&gt;&lt;br&gt;Neil Chambers wrote at Friday, 27. November 2009 11:49:
&lt;br&gt;&lt;br&gt;&amp;gt; Hello all,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I have an object which contains a TreeSet of some objects. When the
&lt;br&gt;&amp;gt; object is deserialized using the JsonHierarchicalStreamDriver the
&lt;br&gt;&amp;gt; Collection always contains an extra, empty, element. I have confirmed
&lt;br&gt;&amp;gt; the collection size and deserializing to XML works as expected as does
&lt;br&gt;&amp;gt; obtaining a reference to the collection and iterating over it.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Is this a known behavior?
&lt;br&gt;&lt;br&gt;Yes. It's the normal behavior when a TreeSet is serialized. The &amp;quot;phantom&amp;quot; 
&lt;br&gt;element is the element for the comparator. If you're not interested in the 
&lt;br&gt;comparator, you may simply register a standard CollectionConverter for the 
&lt;br&gt;TreeSet:
&lt;br&gt;&lt;br&gt;xstream.registerConverter(new CollectionConverter(xstream.getMapper()){
&lt;br&gt;&amp;nbsp; boolean canConvert(Class type) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; return type == TreeSet.class;
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;});
&lt;br&gt;&lt;br&gt;&amp;gt; I'm using xstream 1.3.1 &amp; java 1.6.0.15
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;Jörg
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/phantom-element-in-JSON-deserialization-tp26540748p26588481.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26567660</id>
	<title>Re: Re: serialize a specific fields determined at  runtime</title>
	<published>2009-11-29T15:42:23Z</published>
	<updated>2009-11-29T15:42:23Z</updated>
	<author>
		<name>skystar3</name>
	</author>
	<content type="html">Thanks Jörg for your reply&lt;br&gt;&lt;br&gt;i have configured XStream with the following, and still not getting the required behavior:&lt;br&gt;&lt;br&gt;public class FieldSelectors extends MapperWrapper {&lt;br&gt;&lt;br&gt;    public FieldSelectors(Mapper wrapped) {&lt;br&gt;
        super(wrapped);&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    @Override&lt;br&gt;    public boolean shouldSerializeMember(Class definedIn, String fieldName) {&lt;br&gt;&lt;br&gt;        if (definedIn == Person.class &amp;amp; fieldName.equals(&amp;quot;firstName&amp;quot;)) {&lt;br&gt;
            return true;&lt;br&gt;        } else {&lt;br&gt;            return super.shouldSerializeMember(definedIn, fieldName);&lt;br&gt;        }&lt;br&gt;&lt;br&gt;    }&lt;br&gt;&lt;br&gt;}&lt;br&gt;&lt;br&gt;XStream xstream = new XStream() {&lt;br&gt;            protected MapperWrapper wrapMapper(MapperWrapper next) {&lt;br&gt;
                return new FieldSelectors(next);&lt;br&gt;            }&lt;br&gt;&lt;br&gt;        };&lt;br&gt;&lt;br&gt;        FieldSelectors myMapper = (FieldSelectors) xstream.getMapper()&lt;br&gt;                .lookupMapperOfType(FieldSelectors.class);&lt;br&gt;
        myMapper.shouldSerializeMember(Person.class, &amp;quot;firstName&amp;quot;);&lt;br&gt;&lt;br&gt;Waiting your comments on this&lt;br&gt;&lt;br&gt;Thanks&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Nov 25, 2009 at 11:24 AM, Jörg Schaible &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26567660&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joerg.schaible@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;Hi ahmad,&lt;br&gt;
&lt;br&gt;
ahmad wrote at Dienstag, 24. November 2009 11:55:&lt;br&gt;
&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
&amp;gt; I want serialize a specific fields determined at runtime, i am doing it&lt;br&gt;
&amp;gt; using a class that extends MapperWrapper as the following:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; public class FieldSelectors extends MapperWrapper {&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;     Map excplicitlyHandledTypes = new HashMap();&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;     public FieldSelectors(Mapper wrapped) {&lt;br&gt;
&amp;gt;         super(wrapped);&lt;br&gt;
&amp;gt;     }&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;     @Override&lt;br&gt;
&amp;gt;     public boolean shouldSerializeMember(Class definedIn, String&lt;br&gt;
&amp;gt;     fieldName)&lt;br&gt;
&amp;gt; {&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;         if (excplicitlyHandledTypes.containsKey(definedIn)) {&lt;br&gt;
&amp;gt;             return ((Set) excplicitlyHandledTypes.containsKey(definedIn))&lt;br&gt;
&amp;gt;                     .contains(fieldName);&lt;br&gt;
&amp;gt;         } else {&lt;br&gt;
&amp;gt;             return super.shouldSerializeMember(definedIn, fieldName);&lt;br&gt;
&amp;gt;         }&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;     }&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; }&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Xstream configured:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; XStream xstream = new XStream(staxDriver)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;             {&lt;br&gt;
&amp;gt;                 protected MapperWrapper wrapMapper(MapperWrapper next) {&lt;br&gt;
&amp;gt;                     return new FieldSelectors(next);&lt;br&gt;
&amp;gt;                 }&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;             };&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; FieldSelectors myMapper = (FieldSelectors) xstream.getMapper()&lt;br&gt;
&amp;gt;                     .lookupMapperOfType(FieldSelectors.class);&lt;br&gt;
&amp;gt;             myMapper.shouldSerializeMember(EntityPerson.class, &amp;quot;fname&amp;quot;);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; But i am not getting the required behavior&lt;br&gt;
&amp;gt;  Anyone have an idea&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;This should work for serialization, but it does not work for&lt;br&gt;
deserialization. The method is currently not called at deserialization time&lt;br&gt;
if the member actually exists. This is actually an enhancement request&lt;br&gt;
(XSTR-592). See my answer to your other mail for a solution at&lt;br&gt;
deserialization time.&lt;br&gt;
&lt;br&gt;
- Jörg&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
---------------------------------------------------------------------&lt;br&gt;
To unsubscribe from this list, please visit:&lt;br&gt;
&lt;br&gt;
    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-serialize-a-specific-fields-determined-at-runtime-tp26509675p26567660.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26565532</id>
	<title>omitField method cascade to all objects of the class type passed</title>
	<published>2009-11-29T12:10:22Z</published>
	<updated>2009-11-29T12:10:22Z</updated>
	<author>
		<name>skystar3</name>
	</author>
	<content type="html">Hello,&lt;br&gt;&lt;br&gt;I have a Person Entity, and i want to omit some fields in this object, while serialize all field in the other Person object, how this scenario is handled in XStream?&lt;br&gt;&lt;br&gt;Thanks in advance for your help&lt;br&gt;
&lt;br&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/omitField-method-cascade-to-all-objects-of-the-class-type-passed-tp26565532p26565532.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26540748</id>
	<title>phantom element in JSON deserialization</title>
	<published>2009-11-27T02:49:59Z</published>
	<updated>2009-11-27T02:49:59Z</updated>
	<author>
		<name>Neil Chambers</name>
	</author>
	<content type="html">Hello all,
&lt;br&gt;&lt;br&gt;I have an object which contains a TreeSet of some objects. When the 
&lt;br&gt;object is deserialized using the JsonHierarchicalStreamDriver the 
&lt;br&gt;Collection always contains an extra, empty, element. I have confirmed 
&lt;br&gt;the collection size and deserializing to XML works as expected as does 
&lt;br&gt;obtaining a reference to the collection and iterating over it.
&lt;br&gt;&lt;br&gt;Is this a known behavior?
&lt;br&gt;&lt;br&gt;I'm using xstream 1.3.1 &amp; java 1.6.0.15
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;Neil
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/phantom-element-in-JSON-deserialization-tp26540748p26540748.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26510114</id>
	<title>Re: Serialization issue with Jettison</title>
	<published>2009-11-25T01:57:17Z</published>
	<updated>2009-11-25T01:57:17Z</updated>
	<author>
		<name>Jörg Schaible-2</name>
	</author>
	<content type="html">Hi Jerome,
&lt;br&gt;&lt;br&gt;Jerome Louvel wrote at Dienstag, 24. November 2009 17:09:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi Jorg,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I have done more investigation and confirmed that the issue lies in
&lt;br&gt;&amp;gt; Jettison. See related issues:
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://jira.codehaus.org/browse/JETTISON-53&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JETTISON-53&lt;/a&gt;&lt;br&gt;&amp;gt; &lt;a href=&quot;http://jira.codehaus.org/browse/JETTISON-58&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JETTISON-58&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; As suggested in issue 53, removing the hack for nested arrays did solve
&lt;br&gt;&amp;gt; our issue. For now, we are using a custom version of Jettison 1.0.1 (see
&lt;br&gt;&amp;gt; JAR attached).
&lt;/div&gt;&lt;br&gt;thanks for reporting back and confirming the problem.
&lt;br&gt;&lt;br&gt;- Jörg
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Serialization-issue-with-Jettison-tp26082834p26510114.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26510068</id>
	<title>Re: Serializing Object Arrays</title>
	<published>2009-11-25T01:53:55Z</published>
	<updated>2009-11-25T01:53:55Z</updated>
	<author>
		<name>Jörg Schaible-2</name>
	</author>
	<content type="html">Hi Brian,
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26510068&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;brianhiltbrunner@...&lt;/a&gt; wrote at Dienstag, 
&lt;br&gt;24. November 2009 15:43:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; For
&lt;br&gt;&amp;gt; class SomeOuterClass {
&lt;br&gt;&amp;gt; String[] vehicleNames
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I get this:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;lt;SomeOuterClass&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;vehicleNames&amp;gt;
&lt;br&gt;&amp;gt; � &amp;lt;string&amp;gt;Ford&amp;lt;/string&amp;gt;
&lt;br&gt;&amp;gt; � &amp;lt;string&amp;gt;Dodge&amp;lt;/string&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;/vehicleNames&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;/SomeOuterClass&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; But I'd like to get
&lt;br&gt;&amp;gt; &amp;lt;SomeOuterClass&amp;gt;
&lt;br&gt;&amp;gt; �&amp;lt;vehicleNames&amp;gt;Ford&amp;lt;/vehicleNames&amp;gt;
&lt;br&gt;&amp;gt; �&amp;lt;vehicleNames&amp;gt;Dodge&amp;lt;/vehicleNames&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;/SomeOuterClass&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I can get part of the way using a converter like
&lt;br&gt;&amp;gt; xs.registerLocalConverter(SomeClass.class, &amp;quot;vehicleNames&amp;quot;,new
&lt;br&gt;&amp;gt; MyConverter());
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; But doing that I get:
&lt;br&gt;&amp;gt; &amp;lt;SomeOuterClass&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;vehicleNames&amp;gt;
&lt;br&gt;&amp;gt; �&amp;lt;vehicleNames&amp;gt;Ford&amp;lt;/vehicleNames&amp;gt;
&lt;br&gt;&amp;gt; �&amp;lt;vehicleNames&amp;gt;Dodge&amp;lt;/vehicleNames&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;/vehicleNames&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;/SomeOuterClass&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Close, but not what I wanted. &amp;nbsp;I am basically trying to do the same type
&lt;br&gt;&amp;gt; of behavior as you get with addImplicitCollection and suppress the
&lt;br&gt;&amp;gt; wrapping vehicleNames tag from being written.
&lt;/div&gt;&lt;br&gt;That's unfortunately for arrays currently not supported (enhancement request 
&lt;br&gt;XSTR-341). The only solution for now is to write in this case a converter 
&lt;br&gt;for the SomeOuterClass type.
&lt;br&gt;&lt;br&gt;- Jörg
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Serializing-Object-Arrays-tp26496044p26510068.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26510006</id>
	<title>Re: Unmarshalling XML to POJO, deserializing specific tags only</title>
	<published>2009-11-25T01:50:27Z</published>
	<updated>2009-11-25T01:50:27Z</updated>
	<author>
		<name>Jörg Schaible-2</name>
	</author>
	<content type="html">Hi
&lt;br&gt;&lt;br&gt;Jörg Schaible wrote at Mittwoch, 25. November 2009 09:20:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; dudleygb wrote at Freitag, 20. November 2009 15:21:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Hi all,
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; I'm using Xstream quite a lot parsing incomming XML to POJO's. I have
&lt;br&gt;&amp;gt;&amp;gt; found though that my POJO properties, has to match the tags in the XML
&lt;br&gt;&amp;gt;&amp;gt; doc exactly. If I dont want a tag in my POJO I have to still declare the
&lt;br&gt;&amp;gt;&amp;gt; property and then annotate it with @XStreamOmitField. Is it possible to
&lt;br&gt;&amp;gt;&amp;gt; instruct Xstream to just select certain tags from the XML without having
&lt;br&gt;&amp;gt;&amp;gt; to still declare ALL the properties in my POJO based on the incomming
&lt;br&gt;&amp;gt;&amp;gt; XML? ==============================
&lt;br&gt;&amp;gt;&amp;gt; So basically I have this:
&lt;br&gt;&amp;gt;&amp;gt; ==============================
&lt;br&gt;&amp;gt;&amp;gt; &amp;lt;payload&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;telnumber&amp;gt;45533333&amp;lt;/telnumber&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;error&amp;gt;An error occurred&amp;lt;/error&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;lt;/payload&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; ============================
&lt;br&gt;&amp;gt;&amp;gt; Now my POJO is :
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; class Payload
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; private String error;
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; I dont want the tel number, but if I leave it out, an error occurs. You
&lt;br&gt;&amp;gt;&amp;gt; are forced to put in
&lt;br&gt;&amp;gt;&amp;gt; @XStreamOmitField
&lt;br&gt;&amp;gt;&amp;gt; private String telnumber;
&lt;br&gt;&amp;gt;&amp;gt; =================================
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Problem is, I have many payloads, all definitely have the error tag,
&lt;br&gt;&amp;gt;&amp;gt; which is the only tag I want, all other tags must be ignored, but I dont
&lt;br&gt;&amp;gt;&amp;gt; want this massive POJO I have to maintain with @XStreamOmitField
&lt;br&gt;&amp;gt;&amp;gt; everytime I get a payload with a new field I should be ommitting.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; for your case it's probably best to use an own Mapper. Derive from
&lt;br&gt;&amp;gt; MapperWrapper and overload the shouldSerializeMember method. For your own
&lt;br&gt;&amp;gt; types you can decide yourself if its one of the fields that should be
&lt;br&gt;&amp;gt; serialized then. Install the Mapper by overloading the XStream facade:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; new XStream() {
&lt;br&gt;&amp;gt; &amp;nbsp; MapperWrapper wrapMapper(MapperWrapper next) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; return new YourMapper(next);
&lt;br&gt;&amp;gt; &amp;nbsp; }
&lt;br&gt;&amp;gt; }
&lt;/div&gt;&lt;br&gt;Simply to correct myself: This does only work at serialization time, but not 
&lt;br&gt;at deserialization time. See my answer to ahmad in the thread &amp;quot;Serialize 
&lt;br&gt;specific fields&amp;quot; for alternate solutions.
&lt;br&gt;&lt;br&gt;- Jörg
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Unmarshalling-XML-to-POJO%2C-deserializing-specific-tags-only-tp26441593p26510006.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26509874</id>
	<title>Re: Serialize specific fields</title>
	<published>2009-11-25T01:41:46Z</published>
	<updated>2009-11-25T01:41:46Z</updated>
	<author>
		<name>Jörg Schaible-2</name>
	</author>
	<content type="html">Hi ahmad,
&lt;br&gt;&lt;br&gt;ahmad wrote at Dienstag, 24. November 2009 09:12:
&lt;br&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Is there a method that is opposite to omitField(MyClass.class, “myField”)
&lt;br&gt;&amp;gt; in its function, which only serialize the fields that I specify, and omit
&lt;br&gt;&amp;gt; the others?
&lt;br&gt;&lt;br&gt;there are several ways. As you've already learned, the solution with the own 
&lt;br&gt;Mapper does currently only work for serialization, but not for 
&lt;br&gt;deserialization.
&lt;br&gt;&lt;br&gt;One possibility is used in the CGLIBEnhancedConverter. That one derives from 
&lt;br&gt;the ReflectionConverter and filters the fields by name that are normally 
&lt;br&gt;provided with the ReflectionProvider.
&lt;br&gt;&lt;br&gt;Another approach is to use a FieldKeySorter 
&lt;br&gt;(&lt;a href=&quot;http://xstream.codehaus.org/faq.html#Serialization_sort_fields&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xstream.codehaus.org/faq.html#Serialization_sort_fields&lt;/a&gt;). While it 
&lt;br&gt;is basically there to define the sequence of the fields, it can also be used 
&lt;br&gt;to suppress fields.
&lt;br&gt;&lt;br&gt;IIRC, for Serializable types XStream additionally respects the 
&lt;br&gt;&amp;quot;serialPersistentFields&amp;quot; element (see Sun spec).
&lt;br&gt;&lt;br&gt;- Jörg
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Serialize-specific-fields-tp26491993p26509874.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26509675</id>
	<title>Re: serialize a specific fields determined at runtime</title>
	<published>2009-11-25T01:24:15Z</published>
	<updated>2009-11-25T01:24:15Z</updated>
	<author>
		<name>Jörg Schaible-2</name>
	</author>
	<content type="html">Hi ahmad,
&lt;br&gt;&lt;br&gt;ahmad wrote at Dienstag, 24. November 2009 11:55:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I want serialize a specific fields determined at runtime, i am doing it
&lt;br&gt;&amp;gt; using a class that extends MapperWrapper as the following:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; public class FieldSelectors extends MapperWrapper {
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Map excplicitlyHandledTypes = new HashMap();
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; public FieldSelectors(Mapper wrapped) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super(wrapped);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; @Override
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; public boolean shouldSerializeMember(Class definedIn, String
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; fieldName)
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (excplicitlyHandledTypes.containsKey(definedIn)) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return ((Set) excplicitlyHandledTypes.containsKey(definedIn))
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .contains(fieldName);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return super.shouldSerializeMember(definedIn, fieldName);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Xstream configured:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; XStream xstream = new XStream(staxDriver)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; protected MapperWrapper wrapMapper(MapperWrapper next) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return new FieldSelectors(next);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; FieldSelectors myMapper = (FieldSelectors) xstream.getMapper()
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .lookupMapperOfType(FieldSelectors.class);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myMapper.shouldSerializeMember(EntityPerson.class, &amp;quot;fname&amp;quot;);
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; But i am not getting the required behavior
&lt;br&gt;&amp;gt; &amp;nbsp;Anyone have an idea
&lt;/div&gt;&lt;br&gt;This should work for serialization, but it does not work for 
&lt;br&gt;deserialization. The method is currently not called at deserialization time 
&lt;br&gt;if the member actually exists. This is actually an enhancement request 
&lt;br&gt;(XSTR-592). See my answer to your other mail for a solution at 
&lt;br&gt;deserialization time.
&lt;br&gt;&lt;br&gt;- Jörg
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-serialize-a-specific-fields-determined-at-runtime-tp26509675p26509675.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26509536</id>
	<title>Re: Is there a way to disable the parent class serialization in XStream?</title>
	<published>2009-11-25T01:11:13Z</published>
	<updated>2009-11-25T01:11:13Z</updated>
	<author>
		<name>Jörg Schaible-2</name>
	</author>
	<content type="html">Hi ahmad,
&lt;br&gt;&lt;br&gt;ahmad wrote at Montag, 23. November 2009 14:21:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thank you for your response
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I mean if i have this structure
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; C --&amp;gt; Extends B --&amp;gt; Extends --&amp;gt; A
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; and i am serializing C, then during serialization i want to skip A (the
&lt;br&gt;&amp;gt; first parent), is this possible with XStream
&lt;/div&gt;&lt;br&gt;See my answer to dudleybg, he actually asked the same question.
&lt;br&gt;&lt;br&gt;- Jörg
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Is-there-a-way-to-disable-the-parent-class-serialization-in-XStream--tp26476375p26509536.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26509493</id>
	<title>Re: XmlArrayList to a single XML file</title>
	<published>2009-11-25T01:09:56Z</published>
	<updated>2009-11-25T01:09:56Z</updated>
	<author>
		<name>Jörg Schaible-2</name>
	</author>
	<content type="html">Hi ahmad
&lt;br&gt;&lt;br&gt;ahmad wrote at Samstag, 21. November 2009 19:22:
&lt;br&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Is it possible to make XmlArrayList output to a single XML file ?
&lt;br&gt;&lt;br&gt;Well, it's the whole purpose of the persistence package to store the 
&lt;br&gt;individual entries of the supported collections in separate files.
&lt;br&gt;&lt;br&gt;Nevertheless, you can easily write an own converter for a collection that 
&lt;br&gt;writes the contents of the collection into a separate file. Simply register 
&lt;br&gt;it as local converter for the target member.
&lt;br&gt;&lt;br&gt;- Jörg
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/XmlArrayList-to-a-single-XML-file-tp26459039p26509493.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26508956</id>
	<title>Re: Unmarshalling XML to POJO, deserializing specific tags only</title>
	<published>2009-11-25T00:20:01Z</published>
	<updated>2009-11-25T00:20:01Z</updated>
	<author>
		<name>Jörg Schaible-2</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;dudleygb wrote at Freitag, 20. November 2009 15:21:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Hi all,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'm using Xstream quite a lot parsing incomming XML to POJO's. I have
&lt;br&gt;&amp;gt; found though that my POJO properties, has to match the tags in the XML doc
&lt;br&gt;&amp;gt; exactly. If I dont want a tag in my POJO I have to still declare the
&lt;br&gt;&amp;gt; property and then annotate it with @XStreamOmitField. Is it possible to
&lt;br&gt;&amp;gt; instruct Xstream to just select certain tags from the XML without having
&lt;br&gt;&amp;gt; to still declare ALL the properties in my POJO based on the incomming XML?
&lt;br&gt;&amp;gt; ==============================
&lt;br&gt;&amp;gt; So basically I have this:
&lt;br&gt;&amp;gt; ==============================
&lt;br&gt;&amp;gt; &amp;lt;payload&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;telnumber&amp;gt;45533333&amp;lt;/telnumber&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;error&amp;gt;An error occurred&amp;lt;/error&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;/payload&amp;gt;
&lt;br&gt;&amp;gt; ============================
&lt;br&gt;&amp;gt; Now my POJO is :
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; class Payload
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; private String error;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I dont want the tel number, but if I leave it out, an error occurs. You
&lt;br&gt;&amp;gt; are forced to put in
&lt;br&gt;&amp;gt; @XStreamOmitField
&lt;br&gt;&amp;gt; private String telnumber;
&lt;br&gt;&amp;gt; =================================
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Problem is, I have many payloads, all definitely have the error tag, which
&lt;br&gt;&amp;gt; is the only tag I want, all other tags must be ignored, but I dont want
&lt;br&gt;&amp;gt; this massive POJO I have to maintain with @XStreamOmitField everytime I
&lt;br&gt;&amp;gt; get a payload with a new field I should be ommitting.
&lt;/div&gt;&lt;br&gt;for your case it's probably best to use an own Mapper. Derive from 
&lt;br&gt;MapperWrapper and overload the shouldSerializeMember method. For your own 
&lt;br&gt;types you can decide yourself if its one of the fields that should be 
&lt;br&gt;serialized then. Install the Mapper by overloading the XStream facade:
&lt;br&gt;&lt;br&gt;new XStream() {
&lt;br&gt;&amp;nbsp; MapperWrapper wrapMapper(MapperWrapper next) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; return new YourMapper(next);
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;- Jörg
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Unmarshalling-XML-to-POJO%2C-deserializing-specific-tags-only-tp26441593p26508956.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26498725</id>
	<title>Re: Serialization issue with Jettison</title>
	<published>2009-11-24T08:09:01Z</published>
	<updated>2009-11-24T08:09:01Z</updated>
	<author>
		<name>jlouvel</name>
	</author>
	<content type="html">Hi Jorg,
&lt;br&gt;&lt;br&gt;I have done more investigation and confirmed that the issue lies in 
&lt;br&gt;Jettison. See related issues:
&lt;br&gt;&lt;a href=&quot;http://jira.codehaus.org/browse/JETTISON-53&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JETTISON-53&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://jira.codehaus.org/browse/JETTISON-58&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JETTISON-58&lt;/a&gt;&lt;br&gt;&lt;br&gt;As suggested in issue 53, removing the hack for nested arrays did solve 
&lt;br&gt;our issue. For now, we are using a custom version of Jettison 1.0.1 (see 
&lt;br&gt;JAR attached).
&lt;br&gt;&lt;br&gt;Best regards,
&lt;br&gt;Jerome
&lt;br&gt;&lt;br&gt;&lt;br&gt;Jörg Schaible a écrit :
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi Jerome,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Jerome Louvel wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Hi Jorg,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Thanks for the prompt reply and for the link back to Restlet :) I added
&lt;br&gt;&amp;gt;&amp;gt; an advice regarding the Jettison version in our wiki and look forward to
&lt;br&gt;&amp;gt;&amp;gt; playing with next XStream version!
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Another feature we are eager to have is the support for XStream on GAE.
&lt;br&gt;&amp;gt;&amp;gt; We already ship a Restlet edition for GAE and would benefit from
&lt;br&gt;&amp;gt;&amp;gt; shipping our XStream extension as well. Here is our related issue:
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://restlet.tigris.org/issues/show_bug.cgi?id=863&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://restlet.tigris.org/issues/show_bug.cgi?id=863&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; this is also target for the next release.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; --
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Something that is puzzling me is how can Jettison produce two different
&lt;br&gt;&amp;gt;&amp;gt; JSON outputs if the Stax events are strictly identical?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ? They are not. As you said, you switched the declaration. Sequence matters
&lt;br&gt;&amp;gt; for XML.
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; Doesn't the fact that switching the declarations order of the fields in
&lt;br&gt;&amp;gt;&amp;gt; the Java class solves the issue, imply that XStream might actually
&lt;br&gt;&amp;gt;&amp;gt; produces the Stax events in a slightly different order, maybe confusing
&lt;br&gt;&amp;gt;&amp;gt; Jettison?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Replace the JSON driver with the one of StAX and you see what XStream
&lt;br&gt;&amp;gt; generates calling the XMLStreamWriter of StAX.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; In other words, could the XML output be similar even though Stax events
&lt;br&gt;&amp;gt;&amp;gt; are sent in a slightly different order?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Jettison has to have a heuristic to determin out of the calls of the
&lt;br&gt;&amp;gt; XMLStreamWriter when to write a JSONArray instead of a JSONObject. An array
&lt;br&gt;&amp;gt; is generated if two siblings (in sequence ?) start have the same name. For
&lt;br&gt;&amp;gt; whatever reason it forgets in the fist case that the second (nested) 'b'
&lt;br&gt;&amp;gt; element is actually not a neighbor.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; - Jörg
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt; To unsubscribe from this list, please visit:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;/div&gt;&lt;br /&gt; &lt;br /&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;jettison-1.0.1b.jar&lt;/strong&gt; (75K) &lt;a href=&quot;http://old.nabble.com/attachment/26498725/0/jettison-1.0.1b.jar&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Serialization-issue-with-Jettison-tp26082834p26498725.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26498595</id>
	<title>Re: Serializing Object Arrays</title>
	<published>2009-11-24T07:07:32Z</published>
	<updated>2009-11-24T07:07:32Z</updated>
	<author>
		<name>brianhiltbrunner</name>
	</author>
	<content type="html">Mohamed Mansour &amp;lt;m0.interactive@...&amp;gt; writes:
&lt;br&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;a href=&quot;http://xstream.codehaus.org/javadoc/com/thoughtworks/xstream/annotations/XStreamImplicit.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xstream.codehaus.org/javadoc/com/thoughtworks/xstream/annotations/XStreamImplicit.html&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; You would really need to learn how to read the documentation online :)
&lt;br&gt;Everything is explained there.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; - Mohamed MansourOn Tue, Nov 24, 2009 at 9:43 AM, 
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26498595&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;brianhiltbrunner@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; For
&lt;br&gt;&amp;gt; class SomeOuterClass {
&lt;br&gt;&amp;gt; String[] vehicleNames
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; I get this:
&lt;br&gt;&amp;gt; &amp;lt;SomeOuterClass&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;vehicleNames&amp;gt;
&lt;br&gt;&amp;gt;   &amp;lt;string&amp;gt;Ford&amp;lt;/string&amp;gt;
&lt;br&gt;&amp;gt;   &amp;lt;string&amp;gt;Dodge&amp;lt;/string&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;/vehicleNames&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;/SomeOuterClass&amp;gt;
&lt;br&gt;&amp;gt; But I'd like to get
&lt;br&gt;&amp;gt; &amp;lt;SomeOuterClass&amp;gt;
&lt;br&gt;&amp;gt;  &amp;lt;vehicleNames&amp;gt;Ford&amp;lt;/vehicleNames&amp;gt;
&lt;br&gt;&amp;gt;  &amp;lt;vehicleNames&amp;gt;Dodge&amp;lt;/vehicleNames&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;/SomeOuterClass&amp;gt;
&lt;br&gt;&amp;gt; I can get part of the way using a converter like
&lt;br&gt;&amp;gt; xs.registerLocalConverter(SomeClass.class, &amp;quot;vehicleNames&amp;quot;,new MyConverter());
&lt;br&gt;&amp;gt; But doing that I get:
&lt;br&gt;&amp;gt; &amp;lt;SomeOuterClass&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;vehicleNames&amp;gt;
&lt;br&gt;&amp;gt;  &amp;lt;vehicleNames&amp;gt;Ford&amp;lt;/vehicleNames&amp;gt;
&lt;br&gt;&amp;gt;  &amp;lt;vehicleNames&amp;gt;Dodge&amp;lt;/vehicleNames&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;/vehicleNames&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;/SomeOuterClass&amp;gt;
&lt;br&gt;&amp;gt; Close, but not what I wanted.  I am basically trying to do the same type of
&lt;/div&gt;behavior as you get with addImplicitCollection and suppress the wrapping
&lt;br&gt;vehicleNames tag from being written.
&lt;br&gt;&amp;gt; Brian
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt; To unsubscribe from this list, please visit:
&lt;br&gt;&amp;gt; &amp;nbsp;   &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;br&gt;&lt;br&gt;The class is a generated class from another system. &amp;nbsp;I am not able to annotate
&lt;br&gt;it. &amp;nbsp;I did try to use public void addImplicitCollection(Class ownerType, String
&lt;br&gt;fieldName, String itemFieldName, Class itemType) but that seems to be for
&lt;br&gt;Collections and not String[]. &amp;nbsp;
&lt;br&gt;&lt;br&gt;I am sorry if I am missing the obvious here.
&lt;br&gt;&lt;br&gt;Brian
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Serializing-Object-Arrays-tp26496044p26498595.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26497216</id>
	<title>Re: Serializing Object Arrays</title>
	<published>2009-11-24T06:48:44Z</published>
	<updated>2009-11-24T06:48:44Z</updated>
	<author>
		<name>someuser</name>
	</author>
	<content type="html">&lt;div dir=&quot;ltr&quot;&gt;&lt;a href=&quot;http://xstream.codehaus.org/javadoc/com/thoughtworks/xstream/annotations/XStreamImplicit.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xstream.codehaus.org/javadoc/com/thoughtworks/xstream/annotations/XStreamImplicit.html&lt;/a&gt;&lt;div&gt;&lt;br&gt;

&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;http://xstream.codehaus.org/javadoc/com/thoughtworks/xstream/annotations/XStreamImplicit.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;&lt;/a&gt;You would really need to learn how to read the documentation online :) Everything is explained there.&lt;/div&gt;

&lt;div&gt;&lt;br clear=&quot;all&quot;&gt;  - Mohamed Mansour&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Tue, Nov 24, 2009 at 9:43 AM,  &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26497216&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;brianhiltbrunner@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;

For&lt;br&gt;
class SomeOuterClass {&lt;br&gt;
String[] vehicleNames&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
I get this:&lt;br&gt;
&lt;br&gt;
&amp;lt;SomeOuterClass&amp;gt;&lt;br&gt;
&amp;lt;vehicleNames&amp;gt;&lt;br&gt;
  &amp;lt;string&amp;gt;Ford&amp;lt;/string&amp;gt;&lt;br&gt;
  &amp;lt;string&amp;gt;Dodge&amp;lt;/string&amp;gt;&lt;br&gt;
&amp;lt;/vehicleNames&amp;gt;&lt;br&gt;
&amp;lt;/SomeOuterClass&amp;gt;&lt;br&gt;
&lt;br&gt;
But I&amp;#39;d like to get&lt;br&gt;
&amp;lt;SomeOuterClass&amp;gt;&lt;br&gt;
 &amp;lt;vehicleNames&amp;gt;Ford&amp;lt;/vehicleNames&amp;gt;&lt;br&gt;
 &amp;lt;vehicleNames&amp;gt;Dodge&amp;lt;/vehicleNames&amp;gt;&lt;br&gt;
&amp;lt;/SomeOuterClass&amp;gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I can get part of the way using a converter like&lt;br&gt;
xs.registerLocalConverter(SomeClass.class, &amp;quot;vehicleNames&amp;quot;,new MyConverter());&lt;br&gt;
&lt;br&gt;
But doing that I get:&lt;br&gt;
&amp;lt;SomeOuterClass&amp;gt;&lt;br&gt;
&amp;lt;vehicleNames&amp;gt;&lt;br&gt;
 &amp;lt;vehicleNames&amp;gt;Ford&amp;lt;/vehicleNames&amp;gt;&lt;br&gt;
 &amp;lt;vehicleNames&amp;gt;Dodge&amp;lt;/vehicleNames&amp;gt;&lt;br&gt;
&amp;lt;/vehicleNames&amp;gt;&lt;br&gt;
&amp;lt;/SomeOuterClass&amp;gt;&lt;br&gt;
&lt;br&gt;
Close, but not what I wanted.  I am basically trying to do the same type of behavior as you get with addImplicitCollection and suppress the wrapping vehicleNames tag from being written.&lt;br&gt;
&lt;br&gt;
Brian&lt;br&gt;
&lt;br&gt;
---------------------------------------------------------------------&lt;br&gt;
To unsubscribe from this list, please visit:&lt;br&gt;
&lt;br&gt;
    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Serializing-Object-Arrays-tp26496044p26497216.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26497137</id>
	<title>Re: Serialize specific fields</title>
	<published>2009-11-24T06:43:41Z</published>
	<updated>2009-11-24T06:43:41Z</updated>
	<author>
		<name>someuser</name>
	</author>
	<content type="html">&lt;div dir=&quot;ltr&quot;&gt;I don&amp;#39;t believe so. The way I did it was overriding wrapMapper in XStream. If an XML tag is present and we didn&amp;#39;t omit it, XStream will fail because it can&amp;#39;t map it. By overriding wrapMapper, you can do the following. I only do that to convert XML-&amp;gt;Object.&lt;div&gt;

&lt;br&gt;&lt;blockquote class=&quot;webkit-indent-blockquote&quot; style=&quot;margin: 0 0 0 40px; border: none; padding: 0px;&quot;&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 13px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;

&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&amp;#39;courier new&amp;#39;, monospace&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;XStream stream = new XStream(new DomDriver()) { &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;

&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&amp;#39;courier new&amp;#39;, monospace&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;@Override &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;

&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&amp;#39;courier new&amp;#39;, monospace&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;  protected MapperWrapper wrapMapper(MapperWrapper next) { &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;

&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&amp;#39;courier new&amp;#39;, monospace&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;    MapperWrapper myMapper = new MapperWrapper(next) { &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;

&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&amp;#39;courier new&amp;#39;, monospace&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      @Override &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;

&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&amp;#39;courier new&amp;#39;, monospace&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      public boolean shouldSerializeMember(Class definedIn, String fieldName) { &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;

&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&amp;#39;courier new&amp;#39;, monospace&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;        try { &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;

&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&amp;#39;courier new&amp;#39;, monospace&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;          realClass(realMember(definedIn, fieldName)); &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;

&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&amp;#39;courier new&amp;#39;, monospace&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;        } catch (com.thoughtworks.xstream.mapper.CannotResolveClassException ex) { &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;

&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&amp;#39;courier new&amp;#39;, monospace&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;          return false; &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;

&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&amp;#39;courier new&amp;#39;, monospace&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;        } &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;

&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&amp;#39;courier new&amp;#39;, monospace&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;        return super.shouldSerializeMember(definedIn, fieldName); &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;

&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&amp;#39;courier new&amp;#39;, monospace&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      } &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;

&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&amp;#39;courier new&amp;#39;, monospace&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;    }; &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;

&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&amp;#39;courier new&amp;#39;, monospace&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;    return myMapper; &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;

&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&amp;#39;courier new&amp;#39;, monospace&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;  } &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;

&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 13px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&amp;#39;courier new&amp;#39;, monospace&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;}; &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;

&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;That allowed me to omit all the fields that does not exist. If I didn&amp;#39;t do it that way, it throws an exception and doesn&amp;#39;t allow me to do what I want.&lt;/div&gt;&lt;div&gt;

&lt;br&gt;&lt;/div&gt;&lt;div&gt;I wish there was a facility to omit all but what I defined. Sure it is good to know if it failed due to missing tags, but not practical when we the XML we are reading has been updated and then the users will be annoyed because the product can&amp;#39;t function until the developer omits or adds those fields. :)&lt;/div&gt;

&lt;div&gt;&lt;br clear=&quot;all&quot;&gt;  - Mohamed Mansour&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Tue, Nov 24, 2009 at 3:12 AM, ahmad &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26497137&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ahmadqsoftnet@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; &quot;&gt;

&lt;div dir=&quot;ltr&quot;&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Hello,&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Is there a method that is opposite to omitField(MyClass.class,
“myField”) in its function, which only serialize the fields that I specify, and omit the others?&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Many thanks&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br&gt;&lt;/p&gt;

&lt;/div&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Serialize-specific-fields-tp26491993p26497137.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26496044</id>
	<title>Serializing Object Arrays</title>
	<published>2009-11-24T05:40:58Z</published>
	<updated>2009-11-24T05:40:58Z</updated>
	<author>
		<name>brianhiltbrunner</name>
	</author>
	<content type="html">For 
&lt;br&gt;class SomeOuterClass {
&lt;br&gt;String[] vehicleNames
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;I get this:
&lt;br&gt;&lt;br&gt;&amp;lt;SomeOuterClass&amp;gt;
&lt;br&gt;&amp;lt;vehicleNames&amp;gt;
&lt;br&gt;  &amp;lt;string&amp;gt;Ford&amp;lt;/string&amp;gt;
&lt;br&gt;  &amp;lt;string&amp;gt;Dodge&amp;lt;/string&amp;gt;
&lt;br&gt;&amp;lt;/vehicleNames&amp;gt;
&lt;br&gt;&amp;lt;/SomeOuterClass&amp;gt;
&lt;br&gt;&lt;br&gt;But I'd like to get
&lt;br&gt;&amp;lt;SomeOuterClass&amp;gt;
&lt;br&gt; &amp;lt;vehicleNames&amp;gt;Ford&amp;lt;/vehicleNames&amp;gt;
&lt;br&gt; &amp;lt;vehicleNames&amp;gt;Dodge&amp;lt;/vehicleNames&amp;gt;
&lt;br&gt;&amp;lt;/SomeOuterClass&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;I can get part of the way using a converter like
&lt;br&gt;xs.registerLocalConverter(SomeClass.class, &amp;quot;vehicleNames&amp;quot;,new MyConverter());
&lt;br&gt;&lt;br&gt;But doing that I get:
&lt;br&gt;&amp;lt;SomeOuterClass&amp;gt;
&lt;br&gt;&amp;lt;vehicleNames&amp;gt;
&lt;br&gt; &amp;lt;vehicleNames&amp;gt;Ford&amp;lt;/vehicleNames&amp;gt;
&lt;br&gt; &amp;lt;vehicleNames&amp;gt;Dodge&amp;lt;/vehicleNames&amp;gt;
&lt;br&gt;&amp;lt;/vehicleNames&amp;gt;
&lt;br&gt;&amp;lt;/SomeOuterClass&amp;gt;
&lt;br&gt;&lt;br&gt;Close, but not what I wanted. &amp;nbsp;I am basically trying to do the same type of behavior as you get with addImplicitCollection and suppress the wrapping vehicleNames tag from being written.
&lt;br&gt;&lt;br&gt;Brian
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Serializing-Object-Arrays-tp26496044p26496044.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26491993</id>
	<title>Serialize specific fields</title>
	<published>2009-11-24T00:12:25Z</published>
	<updated>2009-11-24T00:12:25Z</updated>
	<author>
		<name>skystar3</name>
	</author>
	<content type="html">&lt;div dir=&quot;ltr&quot;&gt;&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 12&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 12&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CDOCUME%7E1%5CASUS%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;link rel=&quot;themeData&quot; href=&quot;file:///C:%5CDOCUME%7E1%5CASUS%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot;&gt;&lt;link rel=&quot;colorSchemeMapping&quot; href=&quot;file:///C:%5CDOCUME%7E1%5CASUS%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml&quot;&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Hello,&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Is there a method that is opposite to omitField(MyClass.class,
“myField”) in its function, which only serialize the fields that I specify, and omit the others?&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Many thanks&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br&gt;&lt;/p&gt;

&lt;/div&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Serialize-specific-fields-tp26491993p26491993.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26477946</id>
	<title>Re: Is there a way to disable the parent class  serialization in XStream?</title>
	<published>2009-11-23T05:21:54Z</published>
	<updated>2009-11-23T05:21:54Z</updated>
	<author>
		<name>skystar3</name>
	</author>
	<content type="html">&lt;div dir=&quot;ltr&quot;&gt;Hello &lt;br&gt;&lt;br&gt;Thank you for your response&lt;br&gt;&lt;br&gt;I mean if i have this structure &lt;br&gt;&lt;br&gt;C --&amp;gt; Extends B --&amp;gt; Extends  --&amp;gt; A&lt;br&gt;&lt;br&gt;and i am serializing C, then during serialization i want to skip A (the first parent), is this possible with XStream&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Mon, Nov 23, 2009 at 2:43 PM, Christine Karman &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26477946&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;christine@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
&lt;div class=&quot;im&quot;&gt;ahmad wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Hello,&lt;br&gt;
Is there a way to disable the parent class (superClass of the entity) during serialization in XStream?&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;
What do you mean by &amp;quot;disable the parent class&amp;quot; ?&lt;br&gt;&lt;font color=&quot;#888888&quot;&gt;
&lt;br&gt;
-- &lt;br&gt;
dagdag is just a two-character rotation of byebye.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
---------------------------------------------------------------------&lt;br&gt;
To unsubscribe from this list, please visit:&lt;br&gt;
&lt;br&gt;
   &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Is-there-a-way-to-disable-the-parent-class-serialization-in-XStream--tp26476375p26477946.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26477401</id>
	<title>Re: Is there a way to disable the parent class serialization in XStream?</title>
	<published>2009-11-23T04:43:28Z</published>
	<updated>2009-11-23T04:43:28Z</updated>
	<author>
		<name>xtien</name>
	</author>
	<content type="html">ahmad wrote:
&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt; Is there a way to disable the parent class (superClass of the entity) 
&lt;br&gt;&amp;gt; during serialization in XStream?
&lt;br&gt;What do you mean by &amp;quot;disable the parent class&amp;quot; ?
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;dagdag is just a two-character rotation of byebye.
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Is-there-a-way-to-disable-the-parent-class-serialization-in-XStream--tp26476375p26477401.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26476375</id>
	<title>Is there a way to disable the parent class serialization in XStream?</title>
	<published>2009-11-23T03:25:31Z</published>
	<updated>2009-11-23T03:25:31Z</updated>
	<author>
		<name>skystar3</name>
	</author>
	<content type="html">&lt;div dir=&quot;ltr&quot;&gt;Hello,&lt;br&gt;Is there a way to disable the parent class (superClass of the entity) during serialization in XStream?&lt;br&gt;&lt;br&gt;waiting your urgent reply&lt;br&gt;many thanks&lt;br&gt;Ahmad&lt;br&gt;&lt;/div&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Is-there-a-way-to-disable-the-parent-class-serialization-in-XStream--tp26476375p26476375.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26459039</id>
	<title>XmlArrayList to a single XML file</title>
	<published>2009-11-21T10:22:57Z</published>
	<updated>2009-11-21T10:22:57Z</updated>
	<author>
		<name>skystar3</name>
	</author>
	<content type="html">Hello,&lt;br&gt;&lt;br&gt;Is it possible to make XmlArrayList output to a single XML file ?&lt;br&gt;&lt;br&gt;Many thanks&lt;br&gt;&lt;br&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/XmlArrayList-to-a-single-XML-file-tp26459039p26459039.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26454144</id>
	<title>Re: NullPointerException when serializing a List</title>
	<published>2009-11-20T22:25:45Z</published>
	<updated>2009-11-20T22:25:45Z</updated>
	<author>
		<name>skystar3</name>
	</author>
	<content type="html">Hello Jorg, Joe,&lt;br&gt;&lt;br&gt;The problem solved after creating the folder, and pass it as an arguement.&lt;br&gt;&lt;br&gt;Many thanks&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Fri, Nov 20, 2009 at 12:16 PM, Joe Walnes &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26454144&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joe@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;Just a thought, are you writing to a directory you don&amp;#39;t have permission to? It looks like you&amp;#39;re trying to write to /collection.&lt;div&gt;
&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Nov 18, 2009 at 7:33 AM, Ahmad Qatramiz &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26454144&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ahmadqsoftnet@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;

&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;&lt;div dir=&quot;ltr&quot;&gt;Hello&lt;br&gt;&lt;br&gt;I am trying to convert a List of objects to XML using the FilePersistenceStrategy as the following:&lt;br&gt;

&lt;br&gt;PersistenceStrategy fileStrategy = new FilePersistenceStrategy(&lt;br&gt;                new File(File.separator + &amp;quot;collection&amp;quot;));&lt;br&gt;
&lt;br&gt;        XmlArrayList aList = new XmlArrayList(fileStrategy);&lt;br&gt;        Iterator&amp;lt;Entity&amp;gt; iter = list.iterator();&lt;br&gt;&lt;br&gt;        while (iter.hasNext()) {&lt;br&gt;            Entity obj = iter.next();&lt;br&gt;            aList.add(obj);&lt;br&gt;


        }&lt;br&gt;&lt;br&gt;But when it gets to  aList.add(obj); it throws a NullPointerException&lt;br&gt;&lt;br&gt;Any idea?&lt;br&gt;&lt;br&gt;Thank you in advance&lt;br&gt;&lt;br&gt;Regards&lt;br&gt;Ahmad&lt;br&gt;&lt;/div&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/NullPointerException-when-serializing-a-List-tp26403654p26454144.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26441593</id>
	<title>Unmarshalling XML to POJO, deserializing specific tags only</title>
	<published>2009-11-20T06:21:55Z</published>
	<updated>2009-11-20T06:21:55Z</updated>
	<author>
		<name>dudleygb</name>
	</author>
	<content type="html">Hi all,
&lt;br&gt;&lt;br&gt;I'm using Xstream quite a lot parsing incomming XML to POJO's. I have found though that my POJO properties, has to match the tags in the XML doc exactly. If I dont want a tag in my POJO I have to still declare the property and then annotate it with @XStreamOmitField. Is it possible to instruct Xstream to just select certain tags from the XML without having to still declare ALL the properties in my POJO based on the incomming XML?
&lt;br&gt;==============================
&lt;br&gt;So basically I have this:
&lt;br&gt;==============================
&lt;br&gt;&amp;lt;payload&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;telnumber&amp;gt;45533333&amp;lt;/telnumber&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;error&amp;gt;An error occurred&amp;lt;/error&amp;gt;
&lt;br&gt;&amp;lt;/payload&amp;gt;
&lt;br&gt;============================
&lt;br&gt;Now my POJO is :
&lt;br&gt;&lt;br&gt;class Payload
&lt;br&gt;&lt;br&gt;private String error;
&lt;br&gt;&lt;br&gt;&lt;br&gt;I dont want the tel number, but if I leave it out, an error occurs. You are forced to put in 
&lt;br&gt;@XStreamOmitField
&lt;br&gt;private String telnumber;
&lt;br&gt;=================================
&lt;br&gt;&lt;br&gt;Problem is, I have many payloads, all definitely have the error tag, which is the only tag I want, all other tags must be ignored, but I dont want this massive POJO I have to maintain with @XStreamOmitField everytime I get a payload with a new field I should be ommitting.
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Unmarshalling-XML-to-POJO%2C-deserializing-specific-tags-only-tp26441593p26441593.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26441429</id>
	<title>Re: Re: Re: ExceptionInInitializerError: Cannot access  defaults field of Properties</title>
	<published>2009-11-20T02:49:06Z</published>
	<updated>2009-11-20T02:49:06Z</updated>
	<author>
		<name>Paweł Stróżniak</name>
	</author>
	<content type="html">Hello Jörg / All,&lt;br&gt;&lt;br&gt;I did manage to actually solve it. I changed the XStream source a bit so that it would help me understand what&amp;#39;s exactly happening.&lt;br&gt;XStream developers caught the RuntimeException and threw ExceptionInInitializerError. I did change it to actually print the stacktrace of the original exception.&lt;br&gt;
It turned out that the solution was to add an entry to Lotus Domino JVM&amp;#39;s java.policy file to allow XStream jar use reflection.&lt;br&gt;So, adding a grant:&lt;br&gt;&lt;br&gt;permission java.lang.reflect.ReflectPermission &amp;quot;suppressAccessChecks&amp;quot;;&lt;br&gt;
&lt;br&gt;solved the case.&lt;br&gt;Hope that helps someone someday ;)&lt;br&gt;&lt;br&gt;Paweł&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;2009/11/20 Jörg Schaible &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26441429&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joerg.schaible@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;Hi Paweł,&lt;br&gt;
&lt;br&gt;
Paweł Stróżniak wrote at Mittwoch, 18. November 2009 09:11:&lt;br&gt;
&lt;div class=&quot;im&quot;&gt;&lt;br&gt;
&amp;gt; Hello again,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; One more thing that might be helpful - the JVM version:&lt;br&gt;
&amp;gt; J2RE 1.4.2 IBM Windows 32 build cn142-20060209 (SR4-1).&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;It&amp;#39;s been a while since I tested XStream on IBM JDK 1.4.2 last, but I did&lt;br&gt;
not encounter problems with the PropertiesConverter. Does the Lotus&lt;br&gt;
environment install/activate a SecurityManager? The PropertiesConverter&lt;br&gt;
tries to access the member with the property defaults with reflection and&lt;br&gt;
seems to fail. Can you provide the complete stack trace?&lt;br&gt;
&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
- Jörg&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
---------------------------------------------------------------------&lt;br&gt;
To unsubscribe from this list, please visit:&lt;br&gt;
&lt;br&gt;
    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;Paweł Stróżniak&lt;br&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ExceptionInInitializerError%3A-Cannot-access-defaults-field-of--Properties-tp26394510p26441429.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26441074</id>
	<title>Re: Re: ExceptionInInitializerError: Cannot access defaults field of Properties</title>
	<published>2009-11-20T02:22:54Z</published>
	<updated>2009-11-20T02:22:54Z</updated>
	<author>
		<name>Jörg Schaible-2</name>
	</author>
	<content type="html">Hi Paweł,
&lt;br&gt;&lt;br&gt;Paweł Stróżniak wrote at Mittwoch, 18. November 2009 09:11:
&lt;br&gt;&lt;br&gt;&amp;gt; Hello again,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; One more thing that might be helpful - the JVM version:
&lt;br&gt;&amp;gt; J2RE 1.4.2 IBM Windows 32 build cn142-20060209 (SR4-1).
&lt;br&gt;&lt;br&gt;It's been a while since I tested XStream on IBM JDK 1.4.2 last, but I did
&lt;br&gt;not encounter problems with the PropertiesConverter. Does the Lotus
&lt;br&gt;environment install/activate a SecurityManager? The PropertiesConverter
&lt;br&gt;tries to access the member with the property defaults with reflection and
&lt;br&gt;seems to fail. Can you provide the complete stack trace?
&lt;br&gt;&lt;br&gt;- Jörg
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ExceptionInInitializerError%3A-Cannot-access-defaults-field-of--Properties-tp26394510p26441074.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26441000</id>
	<title>Re: NullPointerException when serializing a List</title>
	<published>2009-11-20T02:16:06Z</published>
	<updated>2009-11-20T02:16:06Z</updated>
	<author>
		<name>Joe Walnes-3</name>
	</author>
	<content type="html">Just a thought, are you writing to a directory you don&amp;#39;t have permission to? It looks like you&amp;#39;re trying to write to /collection.&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Nov 18, 2009 at 7:33 AM, Ahmad Qatramiz &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26441000&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ahmadqsoftnet@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;&lt;div dir=&quot;ltr&quot;&gt;Hello&lt;br&gt;&lt;br&gt;I am trying to convert a List of objects to XML using the FilePersistenceStrategy as the following:&lt;br&gt;
&lt;br&gt;PersistenceStrategy fileStrategy = new FilePersistenceStrategy(&lt;br&gt;                new File(File.separator + &amp;quot;collection&amp;quot;));&lt;br&gt;
&lt;br&gt;        XmlArrayList aList = new XmlArrayList(fileStrategy);&lt;br&gt;        Iterator&amp;lt;Entity&amp;gt; iter = list.iterator();&lt;br&gt;&lt;br&gt;        while (iter.hasNext()) {&lt;br&gt;            Entity obj = iter.next();&lt;br&gt;            aList.add(obj);&lt;br&gt;

        }&lt;br&gt;&lt;br&gt;But when it gets to  aList.add(obj); it throws a NullPointerException&lt;br&gt;&lt;br&gt;Any idea?&lt;br&gt;&lt;br&gt;Thank you in advance&lt;br&gt;&lt;br&gt;Regards&lt;br&gt;Ahmad&lt;br&gt;&lt;/div&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/NullPointerException-when-serializing-a-List-tp26403654p26441000.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26440969</id>
	<title>Re: NullPointerException when serializing a List</title>
	<published>2009-11-20T02:12:44Z</published>
	<updated>2009-11-20T02:12:44Z</updated>
	<author>
		<name>Jörg Schaible-2</name>
	</author>
	<content type="html">Hi Ahmad,
&lt;br&gt;&lt;br&gt;Ahmad Qatramiz wrote at Mittwoch, 18. November 2009 08:33:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I am trying to convert a List of objects to XML using the
&lt;br&gt;&amp;gt; FilePersistenceStrategy as the following:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; PersistenceStrategy fileStrategy = new FilePersistenceStrategy(
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new File(File.separator + &amp;quot;collection&amp;quot;));
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XmlArrayList aList = new XmlArrayList(fileStrategy);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Iterator&amp;lt;Entity&amp;gt; iter = list.iterator();
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (iter.hasNext()) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Entity obj = iter.next();
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; aList.add(obj);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; But when it gets to &amp;nbsp;aList.add(obj); it throws a NullPointerException
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Any idea?
&lt;/div&gt;&lt;br&gt;without further info - no. Please provide the complete stack trace.
&lt;br&gt;&lt;br&gt;- Jörg
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/NullPointerException-when-serializing-a-List-tp26403654p26440969.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26403993</id>
	<title>Re: Re: ExceptionInInitializerError: Cannot access  defaults field of Properties</title>
	<published>2009-11-18T00:11:35Z</published>
	<updated>2009-11-18T00:11:35Z</updated>
	<author>
		<name>Paweł Stróżniak</name>
	</author>
	<content type="html">Hello again,&lt;br&gt;&lt;br&gt;One more thing that might be helpful - the JVM version: &lt;br&gt;J2RE 1.4.2 IBM Windows 32 build cn142-20060209 (SR4-1).&lt;br&gt;&lt;br&gt;Greets,&lt;br&gt;Paweł&lt;br&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ExceptionInInitializerError%3A-Cannot-access-defaults-field-of--Properties-tp26394510p26403993.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26403654</id>
	<title>NullPointerException when serializing a List</title>
	<published>2009-11-17T23:33:10Z</published>
	<updated>2009-11-17T23:33:10Z</updated>
	<author>
		<name>skystar3</name>
	</author>
	<content type="html">&lt;div dir=&quot;ltr&quot;&gt;Hello&lt;br&gt;&lt;br&gt;I am trying to convert a List of objects to XML using the FilePersistenceStrategy as the following:&lt;br&gt;&lt;br&gt;PersistenceStrategy fileStrategy = new FilePersistenceStrategy(&lt;br&gt;                new File(File.separator + &amp;quot;collection&amp;quot;));&lt;br&gt;
&lt;br&gt;        XmlArrayList aList = new XmlArrayList(fileStrategy);&lt;br&gt;        Iterator&amp;lt;Entity&amp;gt; iter = list.iterator();&lt;br&gt;&lt;br&gt;        while (iter.hasNext()) {&lt;br&gt;            Entity obj = iter.next();&lt;br&gt;            aList.add(obj);&lt;br&gt;
        }&lt;br&gt;&lt;br&gt;But when it gets to  aList.add(obj); it throws a NullPointerException&lt;br&gt;&lt;br&gt;Any idea?&lt;br&gt;&lt;br&gt;Thank you in advance&lt;br&gt;&lt;br&gt;Regards&lt;br&gt;Ahmad&lt;br&gt;&lt;/div&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/NullPointerException-when-serializing-a-List-tp26403654p26403654.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26400225</id>
	<title>Re: Re: ExceptionInInitializerError: Cannot access  defaults field of Properties</title>
	<published>2009-11-17T16:09:46Z</published>
	<updated>2009-11-17T16:09:46Z</updated>
	<author>
		<name>Paweł Stróżniak</name>
	</author>
	<content type="html">Hello Jörg,&lt;br&gt;&lt;br&gt;Thanks for the prompt reply.&lt;br&gt;By lotus environment I mean a code that is being run under JVM provided by the IBM&amp;#39;s Lotus Domino. The code that&amp;#39;s using XStream directly is inside Lotus Java Agent, but the object&amp;#39;s structure/classes are located inside a jar file. This hasn&amp;#39;t caused any problems before...&lt;br&gt;
&lt;br&gt;Paweł&lt;br&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ExceptionInInitializerError%3A-Cannot-access-defaults-field-of--Properties-tp26394510p26400225.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26399906</id>
	<title>Re: ExceptionInInitializerError: Cannot access defaults field of Properties</title>
	<published>2009-11-17T15:37:21Z</published>
	<updated>2009-11-17T15:37:21Z</updated>
	<author>
		<name>Jörg Schaible-2</name>
	</author>
	<content type="html">Hi Pawe?,
&lt;br&gt;&lt;br&gt;Pawe? Stró?niak wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; Hello All,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'm having a problem using XStream in my Lotus environment (but this
&lt;br&gt;&amp;gt; shouldn't matter).
&lt;br&gt;&lt;br&gt;This simply means it does matter.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I'm developing an app. using Eclipse IDE. I have designed objects
&lt;br&gt;&amp;gt; structure (to generate appropriate XML files using XStream) - it all
&lt;br&gt;&amp;gt; worked perfectly when running from Scrapbook Page (in Eclipse), but when I
&lt;br&gt;&amp;gt; have inserted it into the application I get the Error mentioned in the
&lt;br&gt;&amp;gt; subject. Below is the partial stacktrace:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 2009-11-17 16:05:48 &amp;nbsp; HTTP JVM: java.lang.ExceptionInInitializerError:
&lt;br&gt;&amp;gt; Cannot access defaults field of Properties
&lt;br&gt;&amp;gt; 2009-11-17 16:05:48 &amp;nbsp; HTTP JVM: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt;
&lt;/div&gt;com.thoughtworks.xstream.converters.collections.PropertiesConverter.&amp;lt;clinit&amp;gt;(PropertiesConverter.java:46)
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 2009-11-17 16:05:48 &amp;nbsp; HTTP JVM: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; com.thoughtworks.xstream.XStream.setupConverters(XStream.java:647)
&lt;br&gt;&amp;gt; 2009-11-17 16:05:48 &amp;nbsp; HTTP JVM: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; com.thoughtworks.xstream.XStream.&amp;lt;init&amp;gt;(XStream.java:445)
&lt;br&gt;&amp;gt; 2009-11-17 16:05:48 &amp;nbsp; HTTP JVM: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; com.thoughtworks.xstream.XStream.&amp;lt;init&amp;gt;(XStream.java:385)
&lt;br&gt;&amp;gt; 2009-11-17 16:05:48 &amp;nbsp; HTTP JVM: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at
&lt;br&gt;&amp;gt; com.thoughtworks.xstream.XStream.&amp;lt;init&amp;gt;(XStream.java:323)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; XStream I'm using is version 1.3.1.
&lt;br&gt;&amp;gt; Any ideas what could be the problem?
&lt;/div&gt;&lt;br&gt;The PropertiesConverter tries to access a private field of the Properties
&lt;br&gt;object by reflection, but the access fails. So, what means &amp;quot;Lotus
&lt;br&gt;environment&amp;quot;?
&lt;br&gt;&lt;br&gt;&lt;br&gt;- Jörg
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ExceptionInInitializerError%3A-Cannot-access-defaults-field-of--Properties-tp26394510p26399906.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26399864</id>
	<title>Re: Emitting CDATAs for Element contents</title>
	<published>2009-11-17T15:34:52Z</published>
	<updated>2009-11-17T15:34:52Z</updated>
	<author>
		<name>Jörg Schaible-2</name>
	</author>
	<content type="html">Hi Matt,
&lt;br&gt;&lt;br&gt;Matt Passell wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; I have a need to selectively write out the contents of some String fields
&lt;br&gt;&amp;gt; as
&lt;br&gt;&amp;gt; unencoded CDATA blocks within elements. &amp;nbsp;Looking over the archives, I came
&lt;br&gt;&amp;gt; upon this conversation thread:
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/How-to-insert-a-field-as-CDATA-in-an-XML-using-Xstream...-td17080220.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://old.nabble.com/How-to-insert-a-field-as-CDATA-in-an-XML-using-Xstream...-td17080220.html&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I was hoping that with the current code I'd be able to use a custom local
&lt;br&gt;&amp;gt; converter (as described in
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://xstream.codehaus.org/annotations-tutorial.html#LocalConverters&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xstream.codehaus.org/annotations-tutorial.html#LocalConverters&lt;/a&gt;&amp;nbsp;) to
&lt;br&gt;&amp;gt; bypass the encoding logic for certain fields, but it appears that the
&lt;br&gt;&amp;gt; encoding happens inside of PrettyPrintWriter after the Converters have
&lt;br&gt;&amp;gt; already finished. :(
&lt;br&gt;&lt;br&gt;This is because the converters must not make any assumptions about the
&lt;br&gt;format the stream writer emits. Think e.g. of JSON.
&lt;br&gt;&lt;br&gt;&amp;gt; Is there any way I can take advantage of the very convenient annotations
&lt;br&gt;&amp;gt; to
&lt;br&gt;&amp;gt; mark the fields I want emit as CDATA blocks? &amp;nbsp;If not, have any other good
&lt;br&gt;&amp;gt; ideas on how to solve this problem come up since that thread in 2008?
&lt;br&gt;&lt;br&gt;You will need a modified PrettyPrintWriter for this. The snippet I've given
&lt;br&gt;in that thread simply demonstrates the basic idea, you might make this
&lt;br&gt;configurable depending on the name of the tag (overloading also startTag).
&lt;br&gt;&lt;br&gt;- Jörg
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/xstream---user-f12138.html&quot; embed=&quot;fixTarget[12138]&quot; target=&quot;_top&quot; &gt;xstream - user&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Emitting-CDATAs-for-Element-contents-tp26382524p26399864.html" />
</entry>

</feed>
