Package net.officefloor.web.json
Class JacksonHttpObjectResponderFactory
- java.lang.Object
-
- net.officefloor.web.json.JacksonHttpObjectResponderFactory
-
- All Implemented Interfaces:
HttpObjectResponderFactory
public class JacksonHttpObjectResponderFactory extends java.lang.Object implements HttpObjectResponderFactory
JacksonHttpObjectResponderFactory.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description JacksonHttpObjectResponderFactory(com.fasterxml.jackson.databind.ObjectMapper mapper)Initiate with theObjectMapper.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <E extends java.lang.Throwable>
HttpObjectResponder<E>createHttpEscalationResponder(java.lang.Class<E> escalationType)Creates theHttpObjectResponderfor theEscalationtype.<T> HttpObjectResponder<T>createHttpObjectResponder(java.lang.Class<T> objectType)Creates theHttpObjectResponderfor theObjecttype.java.lang.StringgetContentType()Obtains theContent-Typesupported by the createHttpObjectResponderinstances.static java.lang.StringgetEntity(java.lang.Throwable escalation, com.fasterxml.jackson.databind.ObjectMapper mapper)Obtains the entity for theEscalation.
-
-
-
Method Detail
-
getEntity
public static java.lang.String getEntity(java.lang.Throwable escalation, com.fasterxml.jackson.databind.ObjectMapper mapper) throws java.io.IOExceptionObtains the entity for theEscalation.- Parameters:
escalation-ThrowableEscalation.mapper-ObjectMapperto write entity.- Returns:
- Entity for the
Escalation. - Throws:
java.io.IOException- If fails to writeEscalation.
-
getContentType
public java.lang.String getContentType()
Description copied from interface:HttpObjectResponderFactoryObtains theContent-Typesupported by the createHttpObjectResponderinstances.- Specified by:
getContentTypein interfaceHttpObjectResponderFactory- Returns:
Content-Type.
-
createHttpObjectResponder
public <T> HttpObjectResponder<T> createHttpObjectResponder(java.lang.Class<T> objectType)
Description copied from interface:HttpObjectResponderFactoryCreates theHttpObjectResponderfor theObjecttype.- Specified by:
createHttpObjectResponderin interfaceHttpObjectResponderFactory- Type Parameters:
T- Object type.- Parameters:
objectType-Objecttype.- Returns:
HttpObjectResponderfor theObjecttype.
-
createHttpEscalationResponder
public <E extends java.lang.Throwable> HttpObjectResponder<E> createHttpEscalationResponder(java.lang.Class<E> escalationType)
Description copied from interface:HttpObjectResponderFactoryCreates theHttpObjectResponderfor theEscalationtype.- Specified by:
createHttpEscalationResponderin interfaceHttpObjectResponderFactory- Type Parameters:
E-Escalationtype.- Parameters:
escalationType-Escalationtype.- Returns:
HttpObjectResponderfor theEscalationtype.
-
-