You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Ro...@hydro.qc.ca on 2003/02/24 19:13:29 UTC

RE : Set a new object in another object property

I think I will answer my question...

digester.addSetNext("field/attr", "setAttr" ); instead of 
digester.addBeanPropertySetter("field/attr");


-----Message d'origine-----
De : Roy.Stephan@hydro.qc.ca [mailto:Roy.Stephan@hydro.qc.ca] 
Envoyé : 24 février, 2003 12:20
À : commons-user@jakarta.apache.org
Objet : Set a new object in another object property

Set a new object in another object property.

The <attr> property of the <field> property is always null. I think I am
missing something.

<field>
	<description>Agency</description>
      <attr>
           	<number>18</number>
           	<code>AGENCE_ID</code>
      </attr>
</field>
...
digester.addObjectCreate("field", VOField.class);
digester.addBeanPropertySetter("field/description");
digester.addObjectCreate("field/attr", VOFieldAttr.class);
digester.addBeanPropertySetter("field/attr/number");
digester.addBeanPropertySetter("field/attr/code");
digester.addBeanPropertySetter("field/attr");
...


The <description> is fine but the <attr> attribute of the <field> object is
always null.
Can someone tell me what I am doing wrong? How can I set the newly created
object <attr> in the <field> object?

Thank you
Stephan