commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <John.E.Gr...@wellsfargo.com>
Subject Digester mixing simple and complex properties
Date Thu, 14 Apr 2005 18:14:53 GMT
Hi all,
 
I'm brand-spanking-new to the Digester.  I'd like to use nested
properties because some are quite long and cumbersome to specify as xml
attributes.  I'd also like to use complex properties.  I can't figure
out the rules, however.  Suppose I have this:
 
<foo>
  <name>foo name</name>
  <bar>
    <name>bar name</name>
  </bar>
</foo>
 
If my rules look like this:
        digester.addObjectCreate("foo", Foo.class);
        digester.addSetNestedProperties("foo");
        digester.addObjectCreate("foo/bar", Bar.class);
        digester.addSetNext("foo/bar", "setBar");
        digester.addSetNestedProperties("foo/bar");

I get "java.lang.NoSuchMethodException: Bean has no property named bar."
If I comment out the addSetNestedProperties("foo") it's ok (foo, bar,
and bar name get populated) except that foo's nested props are ignored.
I've also tried addSetNestedProperties("foo", "bar", null) to no avail.
Is it possible to mix properties like this?  If so, how?
 
thanks
 
 
 
John Gregg
Application Systems Engineer
Wells Fargo Private Client Services Technology
 

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