Castor: how to map a simple list of strings?

Posted by Dmitriy on Stack Overflow See other posts from Stack Overflow or by Dmitriy
Published on 2010-04-08T08:58:14Z Indexed on 2010/04/08 9:03 UTC
Read the original article Hit count: 313

Filed under:
|
|

I have the following field in my class:

private List<String> messages;

Here's the mapping I have:

<field name="messages" collection="arraylist" type="string" container="false>
  <bind-xml name="errors" node="element"/>
</field>

This is what I get as a result of marshalling:

<errors><string>message1</string><string>message2</string></errors>

And this is what I want to achieve:

<errors><error>message1</error><error>message2</error></errors>

Any help is appreciated!

© Stack Overflow or respective owner

Related posts about java

Related posts about castor