Re: JOX and attribut problem
Threre was error into my object
Philippe
String x2=new String("<MarkTest foo='82' bar=\"AAAAAAThis
is the bar value\"><thingies>Moe</thingies>
<thingies>Larry</thingies><sub age=\"36\" name=\"dddd\" /><sub
age=\"35\" name=\"Mark\" /> </MarkTest>");
TestBean2 testBean2=
(TestBean2)BeanXMLMapping.fromXML(x2,TestBean2.class);
import util.xml.jox.*;
import java.util.*;
public class TestBean2 implements java.io.Serializable
{
protected int foo;
protected String bar;
protected Vector thingies;
protected Vector subbean;
public TestBean2()
{
bar = "";
thingies = new Vector();
}
public int getFoo() { return foo; }
public void setFoo(int aFoo) { foo = aFoo; }
public String getBar() { return bar; }
public void setBar(String aBar) { bar = aBar; }
public TestSubbean[] getSub()
{
TestSubbean[] retSubbeans = new TestSubbean[subbean.size()];
if (subbean.size() > 0) subbean.copyInto(retSubbeans);
return retSubbeans;
}
public void setSub(TestSubbean[] newSubbeans)
{
subbean= new Vector(newSubbeans.length);
for (int i=0; i < newSubbeans.length; i++)
{
subbean.addElement(newSubbeans[i]);
}
}
public String[] getThingies()
{
String[] retThingies = new String[thingies.size()];
if (thingies.size() > 0) thingies.copyInto(retThingies);
return retThingies;
}
public TestSubbean getSub(int i) {
return (TestSubbean)subbean.elementAt(i);
}
public void setSub(TestSubbean aSub) {
subbean.addElement(aSub);
}
public void setThingies(String[] newThingies)
{
thingies = new Vector(newThingies.length);
for (int i=0; i < newThingies.length; i++)
{
thingies.addElement(newThingies[i]);
}
}
public String getThingies(int i)
{
return (String) thingies.elementAt(i);
}
public void setThingies(int i, String thingy)
{
thingies.setElementAt(thingy, i);
}
}