commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diego Amicabile <diego...@yahoo.it>
Subject getMappedProperty in PropertyUtils
Date Fri, 18 Jan 2002 12:30:18 GMT
Hi people, 

I am using Mapped Properties from the BeanUtils
project in my web application. I have a bean which has
both indexed properties and mapped Properties which
have the same names, that is these are his public
methods signatures :

  public Object getObject(int index)
  public Object getObject(String key)
  public void setObject(int index, Object param)
  public void setObject(String key, Object param)

when I call the method

  PropertyUtils.getMappedProperty(object,
"property(key)")

or

  PropertyUtils.getMappedProperty(object,
"property","key")

the result is null, because in the method retrieves
first the PropertyDescriptors without the mapped
Descriptors. 
The property descriptor for the indexed property is
found first and returned and since the method checks
whether the descriptor is an instance of
MappedPropertyDescriptor (which is not) the
getObject(String) method is not called and null is
returned (even if something is available)
So the workaround  is giving the mapped properties
names which do not conflict with the other properties.
But I think the getMappedProperty should get FIRST the
mapped property, so that 

property(key) and
property[index] are both available when methods like
the above described are defined in an object.

How do you see it? Shouldn't the method
getMappedProperty be modified?

Greetings
Diego








______________________________________________________________________

Iscriviti al gruppo ufficiale di Tomb Raider:
http://it.groups.yahoo.com/group/gruppoufficiale_tombraider/

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


Mime
View raw message