commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lance Semmens <lance.semm...@essential.com.au>
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?

Thanks,
Lance.

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