org.compass.core.converter.json
Interface JsonContentConverter

All Known Implementing Classes:
DefaultJSONContentConverterImpl, GrailsContentConverter, JacksonContentConverter, JettisonContentConverter

public interface JsonContentConverter

Converts an JsonObject to and from an JSON string.

Author:
kimchy

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.
 

Method Detail

toJSON

String toJSON(JsonObject jsonObject)
              throws ConversionException
Converts an XmlObject into an xml string.

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

AliasedJsonObject fromJSON(String alias,
                           String json)
                           throws ConversionException
Converts a JSON string into an AliasedJsonObject.

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.