commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Valerio Schiavoni <valerio.schiav...@gmail.com>
Subject [digester] setter methods named by element attributes values
Date Thu, 09 Feb 2006 17:44:30 GMT
Hello,
this is the input  xml:
<website>
  <pageclass>
    <page>
      <metadata name="title">the title</metadata>
      <metadata name="content">the content</metadata>
      <metadata name='someUknownName'>...</metadata>
    </page>
  </pageclass>
</website>

in the DigesterReader.java:

digester.addObjectCreate("website/pageclass/page",Notizia.class);

And here comes comes the problems:
--how to call notizia.setTitle("the title"); ?
--how to call notizia.setContent("the content"); ?
--how to call notizia.setUnknownValue("..."); ?

Notizia does provide all necessary setters.

the values of name attributes can vary greatly, so I need a general way to
invoke setter methods, retriving the name of the setter method to be invoked
by looking at the value of the attribute.


thanks to everyone,
valerio

--
To Iterate is Human, to Recurse, Divine
James O. Coplien, Bell Labs
(how good is to be human indeed)

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