2

I've got a question similar to the one asked here:

Convert JSON string to “Object.class”

I'd like to do this without

@JsonTypeInfo(include=As.PROPERTY, use=Id.CLASS, property="class")

on all the classes I wish to serialize/deserialize to/from JSON.

I'd like to do something like:

Object o = mapper.readValue(*a JSON string*, Object.class);

if (o instance of *foo.bar.SomeClass*){

    foo.bar.SomeClass fb = (foo.bar.SomeClass)o

                   *or*

    foo.bar.SomeClass fb = mapper.readValue(*a JSON string*, foo.bar.SomeClass);    }

Is that at all possible?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.