/** * Constructor. * * @param msg The message. Can be <jk>null</jk>. */ public NotImplemented(String msg) { super(msg); setStatus(CODE); }
/** * The main method for serializing POJOs passed in through the {@link RestResponse#setOutput(Object)} method or * returned by the Java method. * * <p> * Subclasses may override this method if they wish to modify the way the output is rendered or support other output * formats. * * <p> * The default implementation simply iterates through the response handlers on this resource * looking for the first one whose {@link ResponseHandler#handle(RestRequest, RestResponse)} method returns * <jk>true</jk>. * * @param req The HTTP request. * @param res The HTTP response. * @throws IOException * @throws RestException */ @Override /* RestCallHandler */ public void handleResponse(RestRequest req, RestResponse res) throws IOException, RestException, NotImplemented { // Loop until we find the correct handler for the POJO. for (ResponseHandler h : context.getResponseHandlers()) if (h.handle(req, res)) return; Object output = res.getOutput(); throw new NotImplemented("No response handlers found to process output of type '"+(output == null ? null : output.getClass().getName())+"'"); }
/** * The main method for serializing POJOs passed in through the {@link RestResponse#setOutput(Object)} method or * returned by the Java method. * * <p> * Subclasses may override this method if they wish to modify the way the output is rendered or support other output * formats. * * <p> * The default implementation simply iterates through the response handlers on this resource * looking for the first one whose {@link ResponseHandler#handle(RestRequest, RestResponse)} method returns * <jk>true</jk>. * * @param req The HTTP request. * @param res The HTTP response. * @throws IOException * @throws RestException */ @Override /* RestCallHandler */ public void handleResponse(RestRequest req, RestResponse res) throws IOException, RestException, NotImplemented { // Loop until we find the correct handler for the POJO. for (ResponseHandler h : context.getResponseHandlers()) if (h.handle(req, res)) return; Object output = res.getOutput(); throw new NotImplemented("No response handlers found to process output of type '"+(output == null ? null : output.getClass().getName())+"'"); }
/** * The main method for serializing POJOs passed in through the {@link RestResponse#setOutput(Object)} method or * returned by the Java method. * * <p> * Subclasses may override this method if they wish to modify the way the output is rendered or support other output * formats. * * <p> * The default implementation simply iterates through the response handlers on this resource * looking for the first one whose {@link ResponseHandler#handle(RestRequest, RestResponse)} method returns * <jk>true</jk>. * * @param req The HTTP request. * @param res The HTTP response. * @throws IOException * @throws RestException */ @Override /* RestCallHandler */ public void handleResponse(RestRequest req, RestResponse res) throws IOException, RestException, NotImplemented { // Loop until we find the correct handler for the POJO. for (ResponseHandler h : context.getResponseHandlers()) if (h.handle(req, res)) return; Object output = res.getOutput(); throw new NotImplemented("No response handlers found to process output of type '"+(output == null ? null : output.getClass().getName())+"'"); }
/** * Constructor. * * @param msg The message. Can be <jk>null</jk>. */ public NotImplemented(String msg) { super(msg); setStatus(CODE); }
@RestMethod public void notImplemented() { throw new NotImplemented(t, "foo {0}", "bar"); } @RestMethod public void payloadTooLarge() { throw new PayloadTooLarge(t, "foo {0}", "bar"); }
/** * Constructor. * * @param msg The message. Can be <jk>null</jk>. */ public NotImplemented(String msg) { super(msg); setStatus(CODE); }
@RestMethod public void notImplemented() { throw new NotImplemented("foo {0}", "bar"); } @RestMethod public void payloadTooLarge() { throw new PayloadTooLarge("foo {0}", "bar"); }
@RestMethod public void notImplemented() { throw new NotImplemented(); } @RestMethod public void payloadTooLarge() { throw new PayloadTooLarge(); }
@RestMethod public void notImplemented() { throw new NotImplemented(t); } @RestMethod public void payloadTooLarge() { throw new PayloadTooLarge(t); }