org.mentawai.ajax.renderer
Class XStreamRenderer

java.lang.Object
  extended by org.mentawai.ajax.renderer.XStreamRenderer
All Implemented Interfaces:
AjaxRenderer

public class XStreamRenderer
extends Object
implements AjaxRenderer

A AjaxRenderer that uses XStream. Depending on the XStream driver, you may generate XML or JSON.

Author:
Rubem Azenha (rubem.azenha@gmail.com)

Field Summary
 
Fields inherited from interface org.mentawai.ajax.AjaxRenderer
APP_JS, APP_JSON, APP_URLENCODED, TEXT_HTML, TEXT_PLAIN, TEXT_XML
 
Constructor Summary
XStreamRenderer()
           
XStreamRenderer(String contentType)
           
XStreamRenderer(com.thoughtworks.xstream.XStream xstream)
           
XStreamRenderer(com.thoughtworks.xstream.XStream xstream, String contentType)
           
 
Method Summary
 String encode(Object obj, Locale loc, boolean prettty)
           
 String getCharset()
           
 String getContentType()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XStreamRenderer

public XStreamRenderer()

XStreamRenderer

public XStreamRenderer(com.thoughtworks.xstream.XStream xstream)

XStreamRenderer

public XStreamRenderer(String contentType)

XStreamRenderer

public XStreamRenderer(com.thoughtworks.xstream.XStream xstream,
                       String contentType)
Method Detail

encode

public String encode(Object obj,
                     Locale loc,
                     boolean prettty)
              throws Exception
Specified by:
encode in interface AjaxRenderer
Throws:
Exception

getContentType

public String getContentType()
Specified by:
getContentType in interface AjaxRenderer

getCharset

public String getCharset()
Specified by:
getCharset in interface AjaxRenderer


Copyright © 2013. All Rights Reserved.