commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yura Ivanov" <iva...@offshorecreations.com.ua>
Subject Re: [BETWIXT] question about collections
Date Fri, 31 Oct 2003 14:45:32 GMT
I want to fill java beans from some xml. This xml I already have and can't
change it.
try this small test.
public class User {
    String name;

    public String getName() {
        return name;
    }

    public void setName(String pName) {
        name= pName;
    }
}
User.betwixt file
<?xml version="1.0" encoding="UTF-8"?>
<info primitiveTypes="element">
<element name="ttt">
<element name="text2" property="text"/>
</element>
</info>


public class UserCollection {
    List userList = new ArrayList();
    public void addUser(User pAddedUser) {
        userList.add(pAddedUser);
    }

    public List getUserList() {
        return userList;
    }
}

UserCollection.betwixt
<?xml version="1.0" encoding="UTF-8"?>
<info primitiveTypes="element">
<element name="behaviour">
<element name="answers" property="answerList">
<addDefaults/>
</element>
</element>
</info>

This works just fine!
But then if I add property to UserCollection for example text and leave
UserCollection.betwixt the same It doesn't work!


----- Original Message ----- 
From: "__matthewHawthorne" <matth@phreaker.net>
To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
Sent: Thursday, October 30, 2003 10:12 PM
Subject: Re: [BETWIXT] question about collections


> I'm not sure why it isn't read correctly without the <addDefaults/> tag.
>
> Why don't you want to use <addDefaults/>?


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message