org.apache.shindig.protocol.conversion
Class BeanJsonConverter
java.lang.Object
org.apache.shindig.protocol.conversion.BeanJsonConverter
- All Implemented Interfaces:
- BeanConverter
public class BeanJsonConverter
- extends Object
- implements BeanConverter
Converts between JSON and java objects.
TODO: Eliminate BeanConverter interface.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BeanJsonConverter
@Inject
public BeanJsonConverter(com.google.inject.Injector injector)
getContentType
public String getContentType()
- Specified by:
getContentType in interface BeanConverter
- Returns:
- the content type of the converted data
convertToString
public String convertToString(Object pojo)
- Convert the passed in object to a string.
- Specified by:
convertToString in interface BeanConverter
- Parameters:
pojo - The object to convert
- Returns:
- An object whose toString method will return json
append
public void append(Appendable buf,
Object pojo)
throws IOException
- Description copied from interface:
BeanConverter
- Serialize object to a buffer. Useful for high performance output.
- Specified by:
append in interface BeanConverter
- Parameters:
buf - Buffer to append topojo - Object to serialize
- Throws:
IOException - If Appendable.append(char) throws an exception.
convertToObject
public <T> T convertToObject(String string,
Class<T> clazz)
- Specified by:
convertToObject in interface BeanConverter
convertToObject
public <T> T convertToObject(String json,
Type type)
convertToObject
public Object convertToObject(Object value,
Type type)
Copyright © 2007-2012. All Rights Reserved.