Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

splitting the Json to Object into two pass #110

Closed
GoogleCodeExporter opened this issue Mar 19, 2015 · 2 comments
Closed

splitting the Json to Object into two pass #110

GoogleCodeExporter opened this issue Mar 19, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

To implement a json-rpc protocol, there are three steps.
First parse the json text to find the callee function and parameter types,
Second, based on type discoverd in first step, deseriallize sub-parts of 
json text into different object.
Third, convert result and other logging info into json.

gson only provided to object  to json  api, make it hard to do the first 
and third step.

This request to split the json to object into two pass.
1\ convert json text to json element tree.
2\ convert json element tree to object.

And split the object to json  into two pass.
1\ convert json element tree to object.
2\ convert json text to json element tree.

Is it possibel to add something like 
public JsonElement toJsonElement(Object src, Type typeOfSrc);
and
public JsonElement toJsonElement(string json);

Thanks.

I have a example.


Original issue reported on code.google.com by yufanyu...@gmail.com on 28 Mar 2009 at 1:20

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant