Class SpringHttpObjectResponderFactory
java.lang.Object
net.officefloor.spring.starter.rest.response.SpringHttpObjectResponderFactory
- All Implemented Interfaces:
HttpEscalationResponder<Throwable>,HttpObjectResponder<Object>,HttpObjectResponderFactory
public class SpringHttpObjectResponderFactory
extends Object
implements HttpObjectResponderFactory, HttpObjectResponder<Object>, HttpEscalationResponder<Throwable>
HttpObjectResponderFactory for Spring.-
Constructor Summary
ConstructorsConstructorDescriptionSpringHttpObjectResponderFactory(SpringExceptionHandler[] exceptionHandlers) Initiate. -
Method Summary
Modifier and TypeMethodDescription<E extends Throwable>
HttpEscalationResponder<E>createHttpEscalationResponder(Class<E> escalationType, boolean isOfficeFloorEscalation) Creates theHttpObjectResponderfor theEscalationtype.<T> HttpObjectResponder<T>createHttpObjectResponder(Class<T> objectType) Creates theHttpObjectResponderfor theObjecttype.Obtains theContent-Typesupported by the createHttpObjectResponderinstances.static voidmethodParameter(ObjectResponse<Object> response) Methodto use if noMethodParameterAnnotation.voidsend(HttpEscalationResponderContext<Throwable> context) Sends theEscalation.voidsend(HttpObjectResponderContext<Object> context) Sends the object.
-
Constructor Details
-
SpringHttpObjectResponderFactory
Initiate.- Parameters:
exceptionHandlers-SpringExceptionHandlerinstances.
-
-
Method Details
-
methodParameter
Methodto use if noMethodParameterAnnotation.- Parameters:
response-ObjectResponse.
-
getContentType
Description copied from interface:HttpObjectResponderFactoryObtains theContent-Typesupported by the createHttpObjectResponderinstances.- Specified by:
getContentTypein interfaceHttpEscalationResponder<Throwable>- Specified by:
getContentTypein interfaceHttpObjectResponder<Object>- Specified by:
getContentTypein interfaceHttpObjectResponderFactory- Returns:
Content-Type.
-
createHttpObjectResponder
Description copied from interface:HttpObjectResponderFactoryCreates the
HttpObjectResponderfor theObjecttype.Should this not handle the
Objecttype, it should returnnull.- Specified by:
createHttpObjectResponderin interfaceHttpObjectResponderFactory- Type Parameters:
T- Object type.- Parameters:
objectType-Objecttype.- Returns:
HttpObjectResponderfor theObjecttype.
-
createHttpEscalationResponder
public <E extends Throwable> HttpEscalationResponder<E> createHttpEscalationResponder(Class<E> escalationType, boolean isOfficeFloorEscalation) Description copied from interface:HttpObjectResponderFactoryCreates the
HttpObjectResponderfor theEscalationtype.Should this not handle the
Escalationtype, it should returnnull.- Specified by:
createHttpEscalationResponderin interfaceHttpObjectResponderFactory- Type Parameters:
E-Escalationtype.- Parameters:
escalationType-Escalationtype.isOfficeFloorEscalation- Indicates ifEscalationis handled byOfficeFloor. Continuing to provide aHttpEscalationResponderindicates a custom response is being provided.- Returns:
HttpObjectResponderfor theEscalationtype.
-
send
Description copied from interface:HttpObjectResponderSends the object.- Specified by:
sendin interfaceHttpObjectResponder<Object>- Parameters:
context-HttpObjectResponderContext.- Throws:
IOException- If fails to send the object.
-
send
Description copied from interface:HttpEscalationResponderSends theEscalation.- Specified by:
sendin interfaceHttpEscalationResponder<Throwable>- Parameters:
context-HttpEscalationResponderContext.- Throws:
IOException- If fails to send the object.
-