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

Use "valueOf()" to customize JSON object #133

Open
darronschall opened this issue Jul 28, 2010 · 0 comments
Open

Use "valueOf()" to customize JSON object #133

darronschall opened this issue Jul 28, 2010 · 0 comments

Comments

@darronschall
Copy link
Contributor

Originally filed by martin.pierre38 on 2010-02-10T14:21:10

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.
Sometimes we need to minimize the memory size of informations. When using
JSON on an object, we should be able to specify only the properties we want
to serialize.

There is a function on the "Object" class called "valueOf()". By default it
returns the object itself. But we can implement it in our object class to
return a custom object.

To do that, just add the line "value = value.valueOf()" at the begining of
the function "ConvertToString" of the "JSONEncoder" class.

Thanks,
Tontonpiero martin.pierre38@gmail.com

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

No branches or pull requests

1 participant