Package org.apache.struts2.rest.handler
Class JacksonJsonHandler
java.lang.Object
org.apache.struts2.rest.handler.AbstractContentTypeHandler
org.apache.struts2.rest.handler.JacksonJsonHandler
- All Implemented Interfaces:
ContentTypeHandler
Handles JSON content using jackson-lib
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromObject
(ActionInvocation invocation, Object obj, String resultCode, Writer stream) Gets the content type for this handlerGets the extension this handler supportsvoid
setDefaultEncoding
(String val) void
toObject
(ActionInvocation invocation, Reader in, Object target) Methods inherited from class org.apache.struts2.rest.handler.AbstractContentTypeHandler
fromObject, toObject
-
Constructor Details
-
JacksonJsonHandler
public JacksonJsonHandler()
-
-
Method Details
-
toObject
- Throws:
IOException
-
fromObject
public String fromObject(ActionInvocation invocation, Object obj, String resultCode, Writer stream) throws IOException - Throws:
IOException
-
getContentType
Description copied from interface:ContentTypeHandler
Gets the content type for this handler- Returns:
- The mime type
-
getExtension
Description copied from interface:ContentTypeHandler
Gets the extension this handler supports- Returns:
- The extension
-
setDefaultEncoding
-