commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simon <>
Subject Re: Using Digester to set static variable
Date Fri, 10 Aug 2007 16:06:50 GMT
On Fri, 2007-08-10 at 10:44 -0500, ying lcs wrote:
> Hi,
> I have a class like this:
> public class Constants {
>    public static int  parameter =  1;
> }
> How can i use digester rule to set the value of parameter of Constants?

Write your own rule implementation, ie your own subclass of the abstract
Rule class.

Assuming you want to use an xml attribute to specify the new parameter
value, you'll just need to override the method:
  public void begin(ns, name, attrs)

If you want the new value to be in the body of an xml element, then
instead override
  public void body(ns, name, text)



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

View raw message