[ 
https://issues.apache.org/jira/browse/PIVOT-764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053485#comment-13053485
 ] 

Edvin Syse commented on PIVOT-764:
----------------------------------

I think I wasn't clear on that my domain object, and the HashMap from my 
example code, is java.util.Map, not org.apache.pivot.collections.Map. I agree 
that the code example works if I use Pivot's Map, but that's not the case for 
any real world domain object :) My patch adds support for java.util.Map. I see 
now that it doesn't need to check for pivot.collections.Map, so it can be 
simplified a bit.

> BeanAdapter should support Map objects
> --------------------------------------
>
>                 Key: PIVOT-764
>                 URL: https://issues.apache.org/jira/browse/PIVOT-764
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>            Reporter: Edvin Syse
>             Fix For: 2.0.1
>
>         Attachments: BeanAdapter-Map-Support.patch
>
>
> BeanAdapter currently does not support the ability to wrap Maps, because it 
> will fail to retrieve the correct getterMethod and setterMethod. My current 
> usecase is that I have a TableView with tableData that consists of objects 
> with path "value-of-type-map.subvalue". The following code should return John 
> Doe in my opinion:
>         HashMap root = new HashMap();
>         HashMap child = new HashMap();
>         child.put("name", "John Doe");
>         root.put("child", child);
>         System.out.println(JSON.get(root, "child.name"));
> I will provide a patch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to