org.compass.core.json
Class RawJsonObject

java.lang.Object
  extended by org.compass.core.json.RawJsonObject
All Implemented Interfaces:
JsonObject
Direct Known Subclasses:
RawAliasedJsonObject

public class RawJsonObject
extends Object
implements JsonObject

An JsonObject that has an json string representation. Mainly used for simpliciy, where Compass will use the configured JsonContentConverter in order to convert to xml string into the actual XmlObject implementation.

This object will only be used when saving json object into Compass. When Compass returns json objects as a restult of a query or get/load operations, the actual JsonObject will be returned.

Naturally, since the json string will only be parsed when Compass will convert this object, all the JsonObject methods are not implemented. The JsonObject is just used as a marker interface to use the correct json supported converters.

Author:
kimchy

Constructor Summary
RawJsonObject(String json)
          Creates a new String based xml object using a String holding the actual xml content.
 
Method Summary
 String getJson()
           
 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

RawJsonObject

public RawJsonObject(String json)
Creates a new String based xml object using a String holding the actual xml content.

Method Detail

getJson

public String getJson()

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

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

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


Copyright (c) 2004-2009 The Compass Project.