org.compass.core.json.grails.converter
Class GrailsContentConverter

java.lang.Object
  extended by org.compass.core.json.grails.converter.GrailsContentConverter
All Implemented Interfaces:
JsonContentConverter

public class GrailsContentConverter
extends Object
implements JsonContentConverter

Converts a JsonObject to String and a String to GrailsAliasedJSONObject.

Author:
kimchy

Constructor Summary
GrailsContentConverter()
           
 
Method Summary
 AliasedJsonObject fromJSON(String alias, String json)
          Converts a JSON string into an AliasedJsonObject.
 String toJSON(JsonObject jsonObject)
          Converts an XmlObject into an xml string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrailsContentConverter

public GrailsContentConverter()
Method Detail

toJSON

public String toJSON(JsonObject jsonObject)
              throws ConversionException
Description copied from interface: JsonContentConverter
Converts an XmlObject into an xml string.

Specified by:
toJSON in interface JsonContentConverter
Parameters:
jsonObject - The JSON object to convert to a JSON string
Returns:
A JSON string representation of the Json object
Throws:
ConversionException - Failed to convert the JSON object to a JSON string

fromJSON

public AliasedJsonObject fromJSON(String alias,
                                  String json)
                           throws ConversionException
Description copied from interface: JsonContentConverter
Converts a JSON string into an AliasedJsonObject.

Specified by:
fromJSON in interface JsonContentConverter
Parameters:
alias - The alias the aliased JSON object is associated with
json - The JSON string that will be converted into an aliases JSON object
Returns:
The aliased JSON object that is the restult of the JSON parsed
Throws:
ConversionException


Copyright (c) 2004-2009 The Compass Project.