commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard <rich...@halldearn.plus.com>
Subject Validator- caching bean reflected getter and setter methods
Date Wed, 09 Apr 2003 11:12:27 GMT
Hi,

I'm new to validator but I'm getting to grips with it, its a great tool.

I'm interested in the function:
 ValidatorUtil.getValueAsString(Object bean, String property).

it uses the struts method:
PropertyUtils.getProperty(bean, property);

I've not read through the code for this function but presume it does not 
cache the get and set methods (its static). This could be sped up 
significantly if the methods were cached I think. something allong the 
lines:

    if (classMethods.containsKey(className)) {
      //get reference to method caches for class
      readMethod  = 
(HashMap)((HashMap)classMethods.get(className)).get("readMethod");
      writeMethod = 
(HashMap)((HashMap)classMethods.get(className)).get("writeMethod");  

Let me know if this would be a good idea....

Regards

richie

Richard Halldearn
OneContent Developer


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message