Steven Swor commented on New Feature XSTR-76

It seems like annotations could provide a solution, at least for primitives, Strings, and collections. Something like this, perhaps?

class Person {
    @XStreamDefaultValue("5")
    private int age;

    @XStreamDefaultValue("Fred")
    private String name;

    @XStreamDefaultValue("false")
    private boolean likesBunnies;

    @XStreamDefaultCollection(XStreamDefaultCollectionType.EMPTY_LIST)
    private List<Person> friends;
}

The use case I'm thinking of is more applicable to dealing with hand-written XML, or at least XML that wasn't written by XStream. Like when migrating a legacy application's codebase to using XStream instead of maintaining its own XML handling code.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to