The purpose of this document is to discuss various tooling options for JSON docuemnts in Netbeans IDE. This is NOT a specification.

Author: Samaresh Panda
Last Updated: 07-07-2008



JSON (JavaScript Object Notation) is a lightweight data-interchange format. Few notes about JSON:

  • It is a simple text format similar to XML.
  • It is language independent.
  • It is a subset of JavaScript.
  • Syntax is similar to C-family languages such as C, C++, Java, JavaScript, Perl, Python etc.

Benefits of JSON over XML

  • JSON is native to Javascript.
  • It is lighter and faster.
  • JSON is typed, i.e it knows about lists, tuples, hashes.
  • Types map directly to programming-language structures.

JSON in Netbeans 6.1

In 6.0 (I think) we introduced some basic json support in Netbeans and it provides:

  • Syntax coloring.
  • Formatting.
  • Brace matching.

JSON Support in Netbeans 6.5 and beyond

Basic Features
Minimally the editor should provide the following features:

Code folds

An example json document may look like this:


An outline of the JSON document. Each node can have a goto source. Here is a picture of how the same document might look like in Navigator

Hints and Quick Fixes.

Similar to Java and other programming languages, json editor could help users with quick fixes and hints.

Syntax Coloring

Perhaps we could extend the coloring scheme a bit further to identify name/value pairs, arrays and so on. It'll be a "nice to have" feature.

JS expression

Optionally, the tool should be able to create expressions that can be used in JS in an XHR call.

Advanced Features
I'm still learning JSON and with my limited knowledge, I think, there are two sides to using JSON. a) Client side consumption b) Server side generation. The advanced features primarily address the server side generation and could have features like:

  • Visual JSON editor.
  • Transformation 1: Create JSON from XML and vice-versa.
  • Transformation 2: Create Java classes from JSON and vice-versa.
  • JSON validation against JSON Schemas.
  • Diff on JSON docs.

External Resources

Description Resources
json.org http://www.json.org/
JSON with JS http://www.json.org/js.html
JSON with Java http://www.json.org/java/index.html
JSON Schema Proposal http://www.json.com/json-schema-proposal/
Json-lib http://json-lib.sourceforge.net/
DOMJSON and SAJ http://sourceforge.net/projects/jontools/
Java Tools for JSON http://jsontools.berlios.de/index.html
Jackson http://www.cowtowncoder.com/hatchery/jackson/index.html
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo