org.compass.core.json.jettison.converter
Class JettisonContentConverter
java.lang.Object
org.compass.core.json.jettison.converter.JettisonContentConverter
- All Implemented Interfaces:
- JsonContentConverter
public class JettisonContentConverter
- extends Object
- implements JsonContentConverter
Converts a JsonObject
to String and a String to
JettisonAliasedJSONObject
.
- Author:
- kimchy
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JettisonContentConverter
public JettisonContentConverter()
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 withjson
- 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-2008 The Compass Project.