org.apache.struts2.rest.handler
Class AbstractContentTypeHandler
java.lang.Object
org.apache.struts2.rest.handler.AbstractContentTypeHandler
- All Implemented Interfaces:
- ContentTypeHandler
- Direct Known Subclasses:
- FormUrlEncodedHandler, HtmlHandler, JacksonLibHandler, JsonLibHandler, MultipartFormDataHandler, XStreamHandler
public abstract class AbstractContentTypeHandler
- extends Object
- implements ContentTypeHandler
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractContentTypeHandler
public AbstractContentTypeHandler()
toObject
public void toObject(Reader in,
Object target)
throws IOException
- Description copied from interface:
ContentTypeHandler
- Populates an object using data from the input stream
- Specified by:
toObject
in interface ContentTypeHandler
- Parameters:
in
- The input stream, usually the body of the requesttarget
- The target, usually the action class
- Throws:
IOException
- If unable to write to the output stream
fromObject
public String fromObject(Object obj,
String resultCode,
Writer stream)
throws IOException
- Description copied from interface:
ContentTypeHandler
- Writes content to the stream
- Specified by:
fromObject
in interface ContentTypeHandler
- Parameters:
obj
- The object to write to the stream, usually the Action classresultCode
- The original result codestream
- The output stream, usually the response
- Returns:
- The new result code
- Throws:
IOException
- If unable to write to the output stream
Copyright © 2000–2017 Apache Software Foundation. All rights reserved.