commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <niall.pember...@gmail.com>
Subject Re: [beanutils] getPropertyType() on java.util.Map
Date Sat, 22 Mar 2008 23:48:22 GMT
On Fri, Mar 21, 2008 at 2:43 PM, Doug Breaux
<breaux@users.sourceforge.net> wrote:
> The following property:
>
>  "myMap(myKey)"
>
>  with a bean property of:
>
>  new java.util.HashMap<String, Long>()
>
>  returns java.util.Map from PropertyUtils.getPropertyType()
>
>  I was expecting Long.  Map seems like a bug.

Well it depends on the getters/setters you have defined. If you have

  public Map getMyMap()
  public void setMyMap(Map)
  public Long getMyMap(String)
  public void setMyMap(String, Long)

Then it should return a Long as the type.

Niall

>  Note that getPropertyType() with a property name of simply "myMap" also
>  returns java.util.Map, which is what I would expect.
>
>  Doug

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


Mime
View raw message