org.apache.shindig.protocol.conversion
Class BeanXStreamConverter

java.lang.Object
  extended by org.apache.shindig.protocol.conversion.BeanXStreamConverter
All Implemented Interfaces:
BeanConverter

public class BeanXStreamConverter
extends Object
implements BeanConverter

Converts to/from XML format using XStream


Field Summary
protected  Map<XStreamConfiguration.ConverterSet,XStreamConfiguration.ConverterConfig> converterMap
           
protected  WriterStack writerStack
           
static String XML_DECL
           
 
Constructor Summary
BeanXStreamConverter(XStreamConfiguration configuration)
           
 
Method Summary
 void append(Appendable buf, Object pojo)
          Serialize object to a buffer.
<T> T
convertToObject(String xml, Class<T> className)
           
 String convertToString(Object pojo)
           
 String getContentType()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_DECL

public static final String XML_DECL
See Also:
Constant Field Values

writerStack

protected WriterStack writerStack

converterMap

protected Map<XStreamConfiguration.ConverterSet,XStreamConfiguration.ConverterConfig> converterMap
Constructor Detail

BeanXStreamConverter

@Inject
public BeanXStreamConverter(XStreamConfiguration configuration)
Method Detail

getContentType

public String getContentType()
Specified by:
getContentType in interface BeanConverter
Returns:
the content type of the converted data

convertToString

public String convertToString(Object pojo)
Specified by:
convertToString in interface BeanConverter

convertToObject

public <T> T convertToObject(String xml,
                             Class<T> className)
Specified by:
convertToObject in interface BeanConverter

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 to
pojo - Object to serialize
Throws:
IOException - If Appendable.append(char) throws an exception.


Copyright © 2007-2012. All Rights Reserved.