pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edvin Syse <ed...@sysedata.no>
Subject Re: No support for Map in BeanAdapter?
Date Wed, 22 Jun 2011 20:08:23 GMT
Den 22.06.2011 22:03, skrev Greg Brown:
>>> I think this has come up before. BeanAdapter wraps a single bean instance and
exposes its (immediate) properties via map methods. You can access nested properties using
JSON.get(), put(), etc.
>>> However, TableView does not currently expect paths in column names, only keys.
It could be modified to use JSON.get() instead, but I'm on the fence about whether that is
a good idea or not.
>> I think it looks like TableView already supports paths in column names. TableView#load
>> JSON.get(context, tableDataKey)
>> and JSON#get will call parse on the tableDataKey, which seems to create an object
navigational graph.
> Right. We already made that change. So what is the problem you are running into? data.group
seems like it should work as a column name.

It doesn't work because BeanAdapter tries to find the getterMethod for 
group in data (which is a Map) and it fails, since it is looking for 
"getData", when it should be looking for "get" with an argument of 
"data". It would require a couple of checks in the lines of if 
(Map.class.isAssignableFrom(beanClass)) to create a spesific getter 
method for Maps, and some other small stuff, but it could be implemented 
very cleanly without any performance hit.

-- Edvin

View raw message