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

Patch to add JSONFormatter #35

Open
GoogleCodeExporter opened this issue Apr 7, 2016 · 2 comments
Open

Patch to add JSONFormatter #35

GoogleCodeExporter opened this issue Apr 7, 2016 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Hi,

Not sure if this is the best way to submit this..  I added a simple mechanism 
to add formatters to types.  Our need is that we always want dates formatted in 
a specific way.

Usage is simple, just register the formatter with JSONValue. 

ex:

JSONValue.registerFormatter(Date.class, new JSONFormatter() {
 @Override
 public String toJSONString(Object value) {
  return ((Date)value).toGMTString();
  }
}); 

Original issue reported on code.google.com by [email protected] on 29 Dec 2010 at 10:31

Attachments:

@GoogleCodeExporter
Copy link
Author

sorry, missed the JSONFormatter interface in the patch.  attached below

Original comment by [email protected] on 29 Dec 2010 at 10:33

Attachments:

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 10 Aug 2013 at 3:47

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

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