Adds new methods and marks current as deprecated

This commit is contained in:
Lukasz Lenart
2017-08-02 14:56:09 +02:00
parent 677ccebe83
commit 287e3bc8cb
@@ -21,6 +21,8 @@
package org.apache.struts2.rest.handler;
import com.opensymphony.xwork2.ActionInvocation;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
@@ -34,9 +36,15 @@ public interface ContentTypeHandler {
* Populates an object using data from the input stream
* @param in The input stream, usually the body of the request
* @param target The target, usually the action class
* @throws IOException If unable to write to the output stream
*
* @deprecated use version which requires {@link ActionInvocation}
*/
@Deprecated
void toObject(Reader in, Object target) throws IOException;
void toObject(ActionInvocation invocation, Reader in, Object target) throws IOException;
/**
* Writes content to the stream
*
@@ -45,9 +53,14 @@ public interface ContentTypeHandler {
* @param stream The output stream, usually the response
* @return The new result code
* @throws IOException If unable to write to the output stream
*
* @deprecated use version which requires {@link ActionInvocation}
*/
@Deprecated
String fromObject(Object obj, String resultCode, Writer stream) throws IOException;
String fromObject(ActionInvocation invocation, Object obj, String resultCode, Writer stream) throws IOException;
/**
* Gets the content type for this handler
*