JSONInputFormat Class

JSONInputFormat is used to read JSON file formats, such as the example shown below:
{ 
    "title": "Talk On Travel Pool", 
    "link": "http://www.flickr.com/groups/talkontravel/pool/", 
    "description": "Travel and vacation photos from around the world.", 
    "modified": "2009-02-02T11:10:27Z", 
    "generator": "http://www.flickr.com/", 
    "items": [ 
            { 
            "title": "View from the hotel", 
            "link": "http://www.flickr.com/photos/33112458@N08/3081564649/in/pool-998875@N22", 
            "media": {"m":"http://farm4.static.flickr.com/3037/3081564649_4a6569750c_m.jpg"}, 
            "date_taken": "2008-12-04T04:43:03-08:00", 
            "description": " Talk On Travel has added a photo to the pool:   ", 
            "published": "2008-12-04T12:43:03Z", 
            "author": "nobody@flickr.com (Talk On Travel)", 
            "author_id": "33112458@N08", 
            "tags": "spain dolphins tenerife canaries lagomera aqualand playadelasamericas junglepark losgigantos loscristines talkontravel" 
            } 
    ] 
}

Configuration


Configuration names consist of the following parameters:

Behavior

Example

Using the JSON example above:

When: The reader will extract all JSON objects that contain the published field and output the configured field values accordingly.
   { 
    "title": "View from the hotel", 
    "link": "http://www.flickr.com/photos/33112458@N08/3081564649/in/pool-998875@N22", 
    "media": {"m":"http://farm4.static.flickr.com/3037/3081564649_4a6569750c_m.jpg"}, 
    "date_taken": "2008-12-04T04:43:03-08:00", 
    "description": " Talk On Travel has added a photo to the pool:   ", 
    "published": "2008-12-04T12:43:03Z", 
    "author": "nobody@flickr.com (Talk On Travel)", 
    "author_id": "33112458@N08", 
    "tags": "spain dolphins tenerife canaries lagomera aqualand playadelasamericas junglepark losgigantos loscristines talkontravel" 
    }


When the configuration is set as shown in the figure above, the output will be:
   View from the hotel ;nobody@flickr.com (Talk On Travel)