V
Vincent Fuchs
Hi all,
I have a problem with Digester : I want to set a parent-child
relationship between 2 objects, and I want to use Digester's addSetTop
method. Here is my XML file :
<?xml version="1.0" encoding="ISO-8859-1"?>
<docExcel>
<onglet name="Lot1">
<cellule positionX="F" positionY="4" type="pourcent">
<seuilBas positionX="E" positionY="4"/>
<seuilHaut positionX="D" positionY="4"/>
<indicateur name="transfert_de_fichiers" periodicite="hebdo"/>
</cellule>
</onglet>
</docExcel>
I want to set the relationship between cellule and onglet, by calling
a setOnglet(Onglet ong) method on a Cellule object. Here is my code :
Digester mapping=new Digester();
mapping.setValidating(false);
mapping.addObjectCreate("docExcel",DocExcel.class);
mapping.addObjectCreate("docExcel/onglet",Onglet.class);
mapping.addSetProperties("docExcel/onglet");
mapping.addObjectCreate("docExcel/onglet/cellule",Cellule.class);
mapping.addSetTop("docExcel/onglet/cellule","setOnglet","divData2csv.excel.Onglet");
mapping.addSetProperties("docExcel/onglet/cellule");
So, in the Digester's stack, from bottom to top, I have a DocExcel, an
Onglet, and a Cellule. According to the documentation, the addSetTop
method should call the setOnglet method on the top object (Cellule),
passing the top-1 object (Onglet) as an argument.
When I execute my program, I have this in the log file :
- Fire begin() for SetTopRule[methodName=setOnglet,
paramType=divData2csv.exel.Onglet]
- Fire begin() for SetPropertiesRules[]
and the properties are set, but nothing else about setOnglet.
Am I misunderstanding the way it should work ? I couldn't find any
example using addSetTop, so if I have some, I would be glad to have a
look at it.
thanks
I have a problem with Digester : I want to set a parent-child
relationship between 2 objects, and I want to use Digester's addSetTop
method. Here is my XML file :
<?xml version="1.0" encoding="ISO-8859-1"?>
<docExcel>
<onglet name="Lot1">
<cellule positionX="F" positionY="4" type="pourcent">
<seuilBas positionX="E" positionY="4"/>
<seuilHaut positionX="D" positionY="4"/>
<indicateur name="transfert_de_fichiers" periodicite="hebdo"/>
</cellule>
</onglet>
</docExcel>
I want to set the relationship between cellule and onglet, by calling
a setOnglet(Onglet ong) method on a Cellule object. Here is my code :
Digester mapping=new Digester();
mapping.setValidating(false);
mapping.addObjectCreate("docExcel",DocExcel.class);
mapping.addObjectCreate("docExcel/onglet",Onglet.class);
mapping.addSetProperties("docExcel/onglet");
mapping.addObjectCreate("docExcel/onglet/cellule",Cellule.class);
mapping.addSetTop("docExcel/onglet/cellule","setOnglet","divData2csv.excel.Onglet");
mapping.addSetProperties("docExcel/onglet/cellule");
So, in the Digester's stack, from bottom to top, I have a DocExcel, an
Onglet, and a Cellule. According to the documentation, the addSetTop
method should call the setOnglet method on the top object (Cellule),
passing the top-1 object (Onglet) as an argument.
When I execute my program, I have this in the log file :
- Fire begin() for SetTopRule[methodName=setOnglet,
paramType=divData2csv.exel.Onglet]
- Fire begin() for SetPropertiesRules[]
and the properties are set, but nothing else about setOnglet.
Am I misunderstanding the way it should work ? I couldn't find any
example using addSetTop, so if I have some, I would be glad to have a
look at it.
thanks