commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <Wendy.Sm...@asu.edu>
Subject [digester] help with digester rules
Date Fri, 07 Jan 2005 17:17:06 GMT

I've only used Digester as a part of Struts, but now I'm trying a simple
standalone example.

I have this XML:
<person key="012456">
  <preferredName>Ms. Janice D. Jones</preferredName>
</person>

And I'm getting the object created and the key set, but none of the
examples I can find shows a property(?) nested immediately within the
object, it's always Catalog->Magazine->title so that you're setting
properties on a child object, then adding the child object to the
parent.

Here's the rules.xml file I'm  using:

<digester-rules>
   <object-create-rule pattern="person"
           classname="edu.asu.vpia.dto.custom.PersonViewImpl" />
   <set-properties-rule pattern="person" >
      <alias attr-name="key" prop-name="key" />
   </set-properties-rule>

   <pattern value="person/preferredName">
      <call-method-rule pattern="preferredName" 
           methodname="setPreferredName" paramcount="0" />
   </pattern>
</digester-rules>

What should the rule be so that it will call setPreferredName directly
on the PersonView object?

Thanks,
-- 
Wendy Smoak

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message