use of ee.jakarta.tck.ws.rs.ee.rs.ext.interceptor.writer.writerinterceptorcontext.ContextOperation in project jaxrs-api by eclipse-ee4j.
the class Resource method genericResponse.
@GET
@Path("{id}")
public Response genericResponse(@PathParam("id") String path) {
ContextOperation op = ContextOperation.valueOf(path.toUpperCase());
ResponseBuilder builder = createResponseBuilderWithHeader(op);
switch(op) {
case GETHEADERS:
for (int i = 0; i != 5; i++) builder = builder.header(TemplateInterceptorBody.PROPERTY + i, "any");
break;
case PROCEEDTHROWSWEBAPPEXCEPTION:
builder.entity(new OnWriteExceptionThrowingStringBean(TemplateInterceptorBody.ENTITY));
break;
default:
break;
}
Response response = builder.build();
return response;
}
Aggregations