I simplified my test case and I think I may have found the culprit. I was
expecting the BeanMap to handle dot notation properly, but it appears I was
mistaken. The following doesn't seem to work:
public static void main (String... args) throws ADKException, IOException {
Student student = new Student();
Map studmap = new BeanMap(student);
studmap.put("id",4242);
studmap.put("name.firstname","Chris");
studmap.put("name.lastname","Pratt");
student.dump();
} //main
I get an IllegalArgumentException that Student has no property called
name.firstname. Is there any way around this? BeanMap isn't really useful
to me if it doesn't support the object hierarchy that a bean engenders?
(*Chris*)
On Thu, Nov 10, 2011 at 5:06 PM, Maurizio Cucchiara
<[email protected]>wrote:
> I'm not sure this is what you are looking for, I'm assuming you are
> trying to write into the student bean, I hope this will be useful (it
> works on my side):
>
> @Test
> public void testBeanMap() throws Exception {
> Student student = new Student();
> BeanMap map = new BeanMap(student);
> assertNotNull(map);
> map.put("id", 1);
> map.put("course", new Course("course name"));
> assertEquals(1, student.getId());
> assertEquals("course name",student.getCourse().getName());
> }
>
>
> Twitter :http://www.twitter.com/m_cucchiara
> G+ :https://plus.google.com/107903711540963855921
> Linkedin :http://www.linkedin.com/in/mauriziocucchiara
>
> Maurizio Cucchiara
>
>
>
> On 11 November 2011 01:51, Chris Pratt <[email protected]> wrote:
> > StringMapAdaptor
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>