Adds new methods and marks current as deprecated
Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/287e3bc8 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/287e3bc8 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/287e3bc8 Branch: refs/heads/support-2-3 Commit: 287e3bc8cbd66fdda04b075bc96362bfd3e2dce9 Parents: 677cceb Author: Lukasz Lenart <lukaszlen...@apache.org> Authored: Wed Aug 2 14:56:09 2017 +0200 Committer: Lukasz Lenart <lukaszlen...@apache.org> Committed: Thu Aug 24 08:49:21 2017 +0200 ---------------------------------------------------------------------- .../struts2/rest/handler/ContentTypeHandler.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts/blob/287e3bc8/plugins/rest/src/main/java/org/apache/struts2/rest/handler/ContentTypeHandler.java ---------------------------------------------------------------------- diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/handler/ContentTypeHandler.java b/plugins/rest/src/main/java/org/apache/struts2/rest/handler/ContentTypeHandler.java index 9ea78e8..a01557e 100644 --- a/plugins/rest/src/main/java/org/apache/struts2/rest/handler/ContentTypeHandler.java +++ b/plugins/rest/src/main/java/org/apache/struts2/rest/handler/ContentTypeHandler.java @@ -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 *