commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikko Nylén <mikko.ny...@gmail.com>
Subject Digester: Problem with CallMethodRule
Date Mon, 05 Sep 2005 04:18:53 GMT
Hi!,

I'm having a little problem with Digester's CallMethodRule: it doesn't 
call the method.

The XML file I try to parse is:

---
<configuration>
  <pages>
    <page path="/index.htm" class="test.TestPage" />
    <page path="/hello.htm" class="test.HelloPage" />
  </pages>
</configuration>
---

The Java code I'm trying to use for parsing the configuration:

---
...
Digester digester = new Digester();
digester.addObjectCreate("configuration", "test.Configuration");
digester.addObjectCreate("configuration/pages/page", 
"test.PageConfiguration");
digester.addSetProperties("configuration/pages/page", new 
String[]{"path", "class"}, new String[]{"path", "className"});
digester.addCallMethod("configuration/pages/page", "freeze");
digester.addSetNext("configuration/pages/page", "addPageConfiguration", 
"test.PageConfiguration");

Configuration configuration = (Configuration)digester.parse(reader);
---

The problem is that the freeze() method of instantiated 
PageConfiguration objects isn't ever called (which results to that the 
Configuration's addPageConfiguration(PageConfiguration) throws an 
IllegalStateException). How I should fix this? I'm using the version 1.7 
of Digester.

- Mikko Nylén

---------------------------------------------------------------------
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