org.compass.core.json.grails
Class GrailsJSONObject

java.lang.Object
  extended by org.compass.core.json.grails.GrailsJSONObject
All Implemented Interfaces:
JsonObject
Direct Known Subclasses:
GrailsAliasedJSONObject

public class GrailsJSONObject
extends Object
implements JsonObject

A wrapper around Grails JSONObject.

Author:
kimchy

Constructor Summary
GrailsJSONObject(org.codehaus.groovy.grails.web.json.JSONObject jsonObject)
           
GrailsJSONObject(String json)
           
 
Method Summary
 boolean isNullValue(Object value)
          Returns true if the given value is a null value.
 Iterator<String> keys()
          Returns a Map holding all the keys and value for the given Json Object.
 Object opt(String key)
          Returns the given object under the key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrailsJSONObject

public GrailsJSONObject(String json)
                 throws org.codehaus.groovy.grails.web.json.JSONException
Throws:
org.codehaus.groovy.grails.web.json.JSONException

GrailsJSONObject

public GrailsJSONObject(org.codehaus.groovy.grails.web.json.JSONObject jsonObject)
Method Detail

keys

public Iterator<String> keys()
Description copied from interface: JsonObject
Returns a Map holding all the keys and value for the given Json Object.

Specified by:
keys in interface JsonObject

opt

public Object opt(String key)
Description copied from interface: JsonObject
Returns the given object under the key. Returns null if nothing is registerd under the key.

Specified by:
opt in interface JsonObject

isNullValue

public boolean isNullValue(Object value)
Description copied from interface: JsonObject
Returns true if the given value is a null value.

Specified by:
isNullValue in interface JsonObject


Copyright (c) 2004-2009 The Compass Project.