Friday Jul 19, 2013

Java API for JSON Processing: An Introduction to JSON

A new article, now up on otn/java, by Oracle’s Jitandra Kotamraju, titled “Java API for JSON Processing: An Introduction to JSON,” takes a look at how Java API for JSON Processing provides portable APIs to parse, generate, transform and query JSON, also known as JavaScript Object Notation. Kotamraju, a principal member of the technical staff at Oracle, is the JSON Processing specification lead.

JSO, a lightweight, text-based, language-independent data exchange format that is easy to read and write by both humans and machines, can represent two structured types: objects and arrays. Kotamraju, the JSON Processing specification lead, explains that “an object is an unordered collection of zero or more name/value pairs. An array is an ordered sequence of zero or more values. The values can be strings, numbers, booleans, null and these two structured types.”

JSON is frequently used in Ajax applications, configurations, databases, and RESTful web services. JSON is offered as the data exchange format with their RESTful web services by all popular websites.

Kotamraju gets under the hood with both the object model and streaming APIs. He concludes that the API for JSON Processing offers the following capabilities:
* “Parsing input streams into immutable objects or event streams
* Writing event streams or immutable objects to output streams
* Programmatically navigating immutable objects
* Programmatically building immutable objects with builders”

The API forms a base for building data binding, transformation, querying, or other manipulation APIs. JAX-RS 2.0 provides native integration for the Java API for JSON Processing.

Check out the article here.

Wednesday Nov 09, 2011

Working with the XML Parser API — JSR 172

Vikram Goyal’s article, “Working with the XML Parser API — JSR 172,” now up on otn/java, covers the basics of the XML Parsing API via a concrete example that uses SAX (Simple API for XML), a parsing method which is now preferred to the alternative method, and DOM (Document Object Model), which has a heavy memory footprint that led the XML Parser API to disallow its use in XML processing. “The XML Parser API,” explains Goyal, “defines the use of the SAX parser for parsing XML documents in resource-constrained devices.”


He explains through a working example what the SAX parser is, how it is defined by the API, and how best to use it.


From the article:


“In a nutshell, for the parsing of a custom XML document, you need to create a handler that extends the DefaultHandler class provided by the API. This custom handler is responsible for listening to the events from the parser and creating the model based on those events (and the supplied data). Your handler is responsible for validating the document and its data.”


Read the article.


Wednesday Aug 31, 2011

Moving Java Forward: Java Summer Workshop 2011

When students tell you, “I could hardly believe I was programming my own game, animations and videos using Java,” or “It is a great opportunity to find out the fun of programming and creating your own animation or whatever you want to create,” and one parent adds “after the workshop, my son is so familiar with Oracle and Java,” I just can tell you it was a great event!

Over 300 Oracle employee sons and daughters, Oracle employees, parents and local high school students and teachers attended the three-day Java Summer Workshop and volunteer training on Greenfoot and Alice (Aug. 8-12 at Oracle HQ). (Alice and Greenfoot are two award winning visual educational software tools to teach Java programming.) The workshop was an introduction to programming only using drag and drop functions for 11 to 18 year old students.

Now available online are the training for Alice and Greenfoot, video student interviews, presentations, additional resources to learn Java, quotes, projects and pictures. Check it out!


Insider News from the Java Team at Oracle!



« November 2015