commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lance Semmens <>
Subject [digester] Setting arbitrary XML attributes
Date Tue, 23 Nov 2004 02:59:21 GMT
I'm wanting to set all XML attributes on my object.
At the time of XML digesting, I don't know the set of attribute names.
If I use a SetPropertiesRule, my object will require a setX() method for
every attribute.

If I parse
	<mybean foo="ABC" bar="123" />

Using the following bean:
	public class MyBean {
		public Map attributes = new HashMap();
		public void setAttribute(String name, String value);

I'd like the digester to do the following:
	MyBean myBean = new MyBean();
	myBean.setAttribute("foo", "ABC");
	myBean.setAttribute("bar", "123");

Is there a digester rule that will do this?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message