Package org.apache.struts2.rest.handler

# Class XStreamHandler

java.lang.Object
org.apache.struts2.rest.handler.XStreamHandler

All Implemented Interfaces:
  `ContentTypeHandler`

public class XStreamHandler extends Object implements ContentTypeHandler
Handles XML content

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `XStreamHandler()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `addDefaultPermissions(ActionInvocation invocation, com.thoughtworks.xstream.XStream stream)`
  `protected com.thoughtworks.xstream.XStream`
  `createXStream(ActionInvocation invocation)`
  `String`
  `fromObject(ActionInvocation invocation, Object obj, String resultCode, Writer out)`
  `String`
  `getContentType()`
  Gets the content type for this handler
  `String`
  `getExtension()`
  Gets the extension this handler supports
  `void`
  `toObject(ActionInvocation invocation, Reader in, Object target)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### XStreamHandler

    public XStreamHandler()

- ## Method Details

  - ### fromObject

    public String fromObject(ActionInvocation invocation, Object obj, String resultCode, Writer out) throws IOException
    Specified by:
      `fromObject` in interface `ContentTypeHandler`
    Throws:
      `IOException`

  - ### toObject

    public void toObject(ActionInvocation invocation, Reader in, Object target)
    Specified by:
      `toObject` in interface `ContentTypeHandler`

  - ### createXStream

    protected com.thoughtworks.xstream.XStream createXStream(ActionInvocation invocation)

  - ### addDefaultPermissions

    protected void addDefaultPermissions(ActionInvocation invocation, com.thoughtworks.xstream.XStream stream)

  - ### getContentType

    public String getContentType()
    Description copied from interface: `ContentTypeHandler`
    Gets the content type for this handler
    Specified by:
      `getContentType` in interface `ContentTypeHandler`
    Returns:
      The mime type

  - ### getExtension

    public String getExtension()
    Description copied from interface: `ContentTypeHandler`
    Gets the extension this handler supports
    Specified by:
      `getExtension` in interface `ContentTypeHandler`
    Returns:
      The extension