Re: [json-lib-user] Error message when transforming to Bean
Brought to you by:
aalmiray
From: Andres A. <aal...@ya...> - 2008-05-24 01:28:04
|
If that is the case then your JSONObjects must contain a 'class' key, the only way for you to filter it out is by registering a PropertyFilter with jsonConfig.setJavaPropertyFilter() Cheers, Andres ------------------------------------------- http://jroller.com/aalmiray http://www.linkedin.com/in/aalmiray -- What goes up, must come down. Ask any system administrator. There are 10 types of people in the world: Those who understand binary, and those who don't. To understand recursion, we must first understand recursion. ----- Original Message ---- From: Kiril <kir...@gm...> To: Andres Almiray <aal...@ya...> Cc: jso...@li... Sent: Friday, May 23, 2008 2:52:34 PM Subject: Re: [json-lib-user] Error message when transforming to Bean No, not at all, all I do with jsonConfig is to set the Root class: jsonConfig.setRootClass( Filter.class ); The problem occurs when morphing beans from json, not reading them. In this case the missing method is a setter for the class property... Kiril. On Fri, May 23, 2008 at 4:34 PM, Andres Almiray <aal...@ya...> wrote: Hi Kiril, Are you by any chance overriding the default exclusion flags by setting jsonConfig.setIgnoreDefaultExcludes(true) ? JsonConfig will exclude class, metaClass and declaringClass properties by default, any property that does not have a read method and has not been excluded nor filtered out would trigger a logging warning (as it seems to be your case). Cheers, Andres ------------------------------------------- http://jroller.com/aalmiray http://www.linkedin.com/in/aalmiray -- What goes up, must come down. Ask any system administrator. There are 10 types of people in the world: Those who understand binary, and those who don't. To understand recursion, we must first understand recursion. ----- Original Message ---- From: Kiril <kir...@gm...> To: jso...@li... Sent: Friday, May 23, 2008 1:00:36 PM Subject: [json-lib-user] Error message when transforming to Bean Hi all, I use BeanMorpher to get classes from JSON, all works Ok, but each time I get this message: Property 'MyClass.class' has no write method. SKIPPED. As I use this frequently, the log is full with these. Any idea what I must do to avoid this? I understand that some setter is expected, but which one?? Here is the code: Morpher myMorpher = new BeanMorpher( MyClass.class,morpherRegistry); morpherRegistry.registerMorpher(myMorpher); MyClass.class = (MyClass)morpherRegistry.morph(MyClass.class,json); Thanks in advance, Kiril. |