commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Thorhauer <j...@zenplex.com>
Subject composite property/bean question
Date Wed, 26 Jun 2002 00:40:42 GMT
Hi,

I am just starting to use betwixt and I have a couple of questions.  I
am working with a small example .xml file that I am trying to map to a
couple of beans.  The problem that I am having is that the
setCompdescription() method in the Componenttest bean is not being
called by betwixt.  It does appear that betwixt is loading 3 new
Componenttest objects for the example .xml file below but it is not
calling the setCompdescription() method.

Any help with this is much appreciated.  I have included summary
versions of each of the files that I am using.

The xml file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<envelope>
  <transaction>
    <content>
      <printingno>555008805581</printingno>
      <componenttest>
        <compdescription>Text</compdescription>
      </componenttest>
      <componenttest>
        <compdescription>Binding</compdescription>
      </componenttest>
      <componenttest>
        <compdescription>Paper Cover</compdescription>
      </componenttest>
    </content>
  </transaction>
</envelope>

I want to map this xml file to 2 beans.  The Beans look like this
(abbreviated):

public class POTest
{
    private List componenttests;
    private String printingNumber = "";

    public POTest(){componenttests = new ArrayList();}

    public List getComponenttests()

    public void addComponenttest(Componenttest c)

    public void setPrintingNumber(String s)

    public String getPrintingNumber()
}


public class Componenttest
{
    private String compDescription = "";

    public Componenttest(){}

    public void setCompdescription(String s)

    public String getCompdescription()
}

I used the following POTest.betwixt map:

<?xml version="1.0" encoding="UTF-8" ?>
<info primitiveTypes="element">
  <element name="content">
    <addDefaults/>
    <element name="printingno" property="printingNumber"/>

    <element name="componenttest" property="componenttests">
       <element name="compdescription" property="compdescription">
    </element>

  </element>
</info>


Thanks,
John 
 
-- 
********************************
** John Thorhauer
** john@zenplex.com
** take a look at:
**  http://tambora.zenplex.org
**  http://www.zenplex.org
**  http://www.zenplex.com
********************************



--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message