Package org.apache.struts2.rest.handler
Interface ContentTypeHandler
- All Known Implementing Classes:
AbstractContentTypeHandler
,FormUrlEncodedHandler
,HtmlHandler
,JacksonJsonHandler
,JacksonXmlHandler
,JuneauXmlHandler
,MultipartFormDataHandler
,XStreamHandler
public interface ContentTypeHandler
Handles transferring content to and from objects for a specific content type
-
Method Summary
Modifier and TypeMethodDescriptionfromObject
(com.opensymphony.xwork2.ActionInvocation invocation, Object obj, String resultCode, Writer stream) fromObject
(Object obj, String resultCode, Writer stream) Deprecated.Gets the content type for this handlerGets the extension this handler supportsvoid
void
Deprecated.use version which requiresActionInvocation
-
Method Details
-
toObject
Deprecated.use version which requiresActionInvocation
Populates an object using data from the input stream- 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
-
toObject
void toObject(com.opensymphony.xwork2.ActionInvocation invocation, Reader in, Object target) throws IOException - Throws:
IOException
-
fromObject
Deprecated.use version which requiresActionInvocation
Writes content to the stream- 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
-
fromObject
String fromObject(com.opensymphony.xwork2.ActionInvocation invocation, Object obj, String resultCode, Writer stream) throws IOException - Throws:
IOException
-
getContentType
String getContentType()Gets the content type for this handler- Returns:
- The mime type
-
getExtension
String getExtension()Gets the extension this handler supports- Returns:
- The extension
-
ActionInvocation