commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Baltz, Kenneth" <Kba...@firstam.com>
Subject RE: Set a new object in another object property
Date Mon, 24 Feb 2003 18:20:26 GMT
I believe you are missing a SetNextRule.  Something like:

digester.addSetNextRule( "field/attr", "addAttr" );

This would have the effect of calling the addAttr() method of your VOField
object and pass it the VOFieldAttr object you created with your second
ObjectCreateRule.  Hopefully you have an addAttr method or something
similar.  If not and you still need help, let us know what you would expect
to happen with the VOFieldAttr object.

K.C.


> -----Original Message-----
> From: Roy.Stephan@hydro.qc.ca [mailto:Roy.Stephan@hydro.qc.ca]
> Sent: Monday, February 24, 2003 9:20 AM
> To: commons-user@jakarta.apache.org
> Subject: 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
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message