commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Goodwin <>
Subject [betwixt] Collection property question
Date Thu, 13 Jan 2005 17:01:41 GMT
I have xml I need to map to my bean.  It is very similar to the 
CustomerBean example, except I am using Collection instead of and array 
of objects (i.e. Order[]).  Here is a sample of the xml, followed by my 
class, followed by my .betwixt file.  The problem I am having is the 
List is always null.  How do you map objects in the .betwixt file if the 
collection has no surrounding element tag (i.e. 

Example xml:

public class AgentStatement implements {
    private Date statementDate;
    private AgentInfo agentInfo;
    private Collection agentStatementDetails = new java.util.ArrayList();
    private AgentEarning agentEarning;
    /* .. snip non-relevant getters/setters */
    public Collection getAgentStatementDetails() {
        return agentStatementDetails;
    public void setAgentStatementDetails(Collection agentStatementDetails) {
        this.agentStatementDetails = agentStatementDetails;
    public void addAgentStatementDetail(AgentStatementDetail 
agentStatementDetail) {

Betwixt file:
<?xml version='1.0' ?>
  <element name='AgentStatementVO'>
      <element name='StatementDate' property='statementDate'/>
      <element name='AgentInfoVO' property='agentInfo'/>
      <element name='AgentStatementLineVO' 
      <element name='AgentEarningsVO' property='agentEarning'/>

Everything except the agentStatementDetails are populated correctly.



Matt Goodwin
"Transcending the Ordinary"

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message