You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by John Thorhauer <jo...@zenplex.com> on 2002/06/26 02:40:42 UTC

composite property/bean question

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>