You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by kanch <po...@gmail.com> on 2009/07/30 11:01:43 UTC

JSONProvider readFrom() method takes Class as first argument.
I am using the cxf-bundle-jaxrs-2.2.2. 

When performing some integration test I needed the JSONProvider class to
convert my JSON objects back to Java objects. From what I understand I can
do this using the readFrom() method in the JSONProvider class, but the
problem is that it only accepts type Class, as the first argument, for the
type of class that you want to convert your JSON object too. Surely the
first argument should be of type Class<?>.

Am I using the method incorrectly? Or is this an error in the code?
-- 
View this message in context: http://www.nabble.com/JSONProvider-readFrom%28%29-method-takes-Class%3CObject%3E-as-first-argument.-tp24734735p24734735.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: JSONProvider readFrom() method takes Class as first argument. Posted by kanch <po...@gmail.com>.
Ok. Thanks Sergey!


Sergey Beryozkin wrote:
> 
> Hi
> 
> I think it won't compile if one uses Class<?>, given that JSONProvider
> implements MessageBodyReader & MessageBodyWriter. In our tests, when using
> JSOnProvider.readFrom directly, we cast the first argument to (Class).
> 
> cheers, Sergey
> 
> 
> kanch wrote:
>> 
>> I am using the cxf-bundle-jaxrs-2.2.2. 
>> 
>> When performing some integration test I needed the JSONProvider class to
>> convert my JSON objects back to Java objects. From what I understand I
>> can do this using the readFrom() method in the JSONProvider class, but
>> the problem is that it only accepts type Class, as the first argument,
>> for the type of class that you want to convert your JSON object too.
>> Surely the first argument should be of type Class<?>.
>> 
>> Am I using the method incorrectly? Or is this an error in the code?
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/JSONProvider-readFrom%28%29-method-takes-Class%3CObject%3E-as-first-argument.-tp24734735p24737436.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: JSONProvider readFrom() method takes Class as first argument. Posted by Sergey Beryozkin <se...@iona.com>.
Hi

I think it won't compile if one uses Class<?>, given that JSONProvider
implements MessageBodyReader & MessageBodyWriter. In our tests, when using
JSOnProvider.readFrom directly, we cast the first argument to (Class).

cheers, Sergey


kanch wrote:
> 
> I am using the cxf-bundle-jaxrs-2.2.2. 
> 
> When performing some integration test I needed the JSONProvider class to
> convert my JSON objects back to Java objects. From what I understand I can
> do this using the readFrom() method in the JSONProvider class, but the
> problem is that it only accepts type Class, as the first argument, for the
> type of class that you want to convert your JSON object too. Surely the
> first argument should be of type Class<?>.
> 
> Am I using the method incorrectly? Or is this an error in the code?
> 

-- 
View this message in context: http://www.nabble.com/JSONProvider-readFrom%28%29-method-takes-Class%3CObject%3E-as-first-argument.-tp24734735p24735222.html
Sent from the cxf-user mailing list archive at Nabble.com.