Hi,

When using BetWixt to convert a XML file to a Java
bean, we can use a list if a XML file is a collection
of beans (e.g. LineBean).  Here is a sample Java code
and XML file:

XmlBeanList.java

import java.util.ArrayList;
import java.util.List;

public class XmlBeanList
{

    public XmlBeanList()
    {
    }

    protected ArrayList list = new ArrayList();

    public void addLine(LineBean bean)
    {
        list.add(bean);
    }

    public List getLines()
    {
        return list;
    }
} 

beanlist.xml

<XmlBeanList >
  <line>
    <lineCode>USA</lineCode >
  </line >
  <line >
    <lineCode>CANADA</lineCode >
  </line >
</XmlBeanList >

BetWixt sets tag <lineCode> for LineBean
automatically. 

Is there any way to use Object, not LineBean for
addLine method as
    
    public void addLine(Object bean)
    {
        list.add(bean);
    }

or LineBean is mandatory needed?

Appreciate your responds. Thanks.




__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to