};
}
private ResponseHandler createResponseHandler(String name, Object value) {
if ("json".equalsIgnoreCase(name)) {
return new AndResponseHandler(of(with(text(toJson(value))), header(HttpHeaders.CONTENT_TYPE, "application/json")));
}
if (isResource(name) && TextContainer.class.isInstance(value)) {
TextContainer container = TextContainer.class.cast(value);
return with(resourceFrom(name, container));