Coder Social home page Coder Social logo

PUBLIC_FIELDS not implemented? about json-io HOT 5 CLOSED

jdereg avatar jdereg commented on August 26, 2024
PUBLIC_FIELDS not implemented?

from json-io.

Comments (5)

daveloyall avatar daveloyall commented on August 26, 2024

Edited the issue to be about PUBLIC_FIELDS, which it actually is about, rather than CUSTOM_FIELDS, which I selected as a "better example" for no particularly good reason. :)

from json-io.

jdereg avatar jdereg commented on August 26, 2024

There is a new 'optionalArg' Map for the public JsonWriter APIs. What this allows, is for new functionality to be added, without changing the JsonWriter's API.

Currently, you can set the key 'DATE_FORMAT' (JsonWriter.DATE_FORMAT) and then set the value of it to a date format String. If this is found, this will be used to write out java.util.Dates.

Also, you can set the value JsonWriter.TYPE to 'true' and it will force @type's to be written out (not recommended, as it will significantly increase the size of the JSON stream). This was added for the rare case where the recipient needs all @type information but cannot infer it (rare occurrence - it was a JBoss rule engine user).

In the future, other such 'hints' will be added to JsonWriter as required. In those cases, JsonWriter will have a public String final key that can be used to place the value into the optionalArgs Map. If you look at the internal _args member variable, and where that is accessed, that is where JsonWriter takes into account the values set into this optionalArgs map.

from json-io.

daveloyall avatar daveloyall commented on August 26, 2024

Please consider amending the javadoc to not mention FieldGrabber or PUBLIC_FIELDS, etc, since they aren't implemented! :) ...Or please double check that you haven't left some commits out of trunk?

from json-io.

jdereg avatar jdereg commented on August 26, 2024

Dave,

Now I see what you were talking about. I think I misunderstood your
question. I got ahead of myself on a comment and have yet to check in the
work (field filtering) that I mention in the comment. I will remove that
from the comment for now.

Field fitlering is coming soon. PUBLIC, ALL_BUT_TRANSIENT, ALL, and a
FieldFilter that you write and associate to a class, allowing your class to
selectively decide what fields get serialized. This will be pretty easy to
implement and further increases json-io's power.

Best regards,
John

On Tue, Dec 31, 2013 at 2:29 PM, Dave Loyall [email protected]:

Please consider amending the javadoc to not mention FieldGrabber or
PUBLIC_FIELDS, etc, since they aren't implemented! :) ...Or please double
check that you haven't left some commits out of trunk?


Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-31407928
.

from json-io.

daveloyall avatar daveloyall commented on August 26, 2024

Sounds great, thank you!

from json-io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.