commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: [Digester] - Read only methods
Date Thu, 29 May 2003 23:29:40 GMT


On Wed, 28 May 2003, Sloan Seaman wrote:

> Date: Wed, 28 May 2003 15:27:56 -0400
> From: Sloan Seaman <sloan@sgi.net>
> Reply-To: Jakarta Commons Users List <commons-user@jakarta.apache.org>
> To: commons-user@jakarta.apache.org
> Subject: [Digester] - Read only methods
>
> Is there any way to get Digester to call methods that it thinks are read only?
>
> I have a public void setActionMappingClass(String) that Digester does
> not call because the get is public Class getActionMappingClass() instead
> of a public String getActionMappingClass()....
>
> Just seems odd that Digester would be so strict...
>

Digester isn't being strict -- your class is breaking the JavaBeans design
pattern requirements for recognizing properties.  This only matters when
you are trying to use rules like SetPropertyRule or SetPropertiesRule that
rely on a promise from you that your beans obey the rules.  Your class
does not conform, so you should not be surprised by this.

You can investigate using something like SetNextRule, where you can
explicitly define the name of the method to be called, and the argument
type it takes.  However, you'll save yourself lots of other work later if
you just make sure that your classes are proper JavaBeans instead.

> Thanks!
>
> --
> Sloan

Craig

Mime
View raw message