public abstract class ApiResource extends HttpExtension
HttpController.HttpExtension.Method| Constructor and Description |
|---|
ApiResource(ApiSignature signature)
Creates an instance with a given signature.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accepts(HttpExtension.Method method,
String type)
Returns
true if this resource accepts a given media type for a given method. |
void |
doDelete(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
void |
doHead(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
void |
doOptions(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
void |
doPut(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
void |
doTrace(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
Set<Exclude> |
excludes()
Returns the set of request paths that should be excluded from request management.
|
static ApiSignature |
handles(String mapping)
Returns a
ApiSignature that declares the method and media types handled by an ApiResource for a given mapping. |
static ApiMethodSignature |
method(HttpExtension.Method method)
Returns an
ApiMethodSignature that declares the media types handled by an ApiResource for a given method. |
boolean |
produces(HttpExtension.Method method,
String type)
Returns
true if this resource produces a given media type for a given method. |
ApiSignature |
signature()
Return the signature of this resource.
|
boolean |
supports(HttpExtension.Method method)
Returns
true if this resource supports a given method. |
context, init, init, mapping, mapping, name, namedestroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, logpublic ApiResource(ApiSignature signature)
signature - the signaturepublic static ApiSignature handles(String mapping)
ApiSignature that declares the method and media types handled by an ApiResource for a given mapping.mapping - the mappingpublic static ApiMethodSignature method(HttpExtension.Method method)
ApiMethodSignature that declares the media types handled by an ApiResource for a given method.method - the methodpublic Set<Exclude> excludes()
ApplicationExtensionexcludes in interface ApplicationExtensionexcludes in class HttpExtensionpublic boolean supports(HttpExtension.Method method)
true if this resource supports a given method.method - the methodtrue if this resource supports the given methodpublic boolean accepts(HttpExtension.Method method, String type)
true if this resource accepts a given media type for a given method.method - the methodtype - the media typetrue if this resource accepts the given media type for the given methodpublic boolean produces(HttpExtension.Method method, String type)
true if this resource produces a given media type for a given method.method - the methodtype - the media typetrue if this resource produces the given media type for the given methodpublic ApiSignature signature()
public void doHead(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
doHead in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionpublic void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
doGet in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionpublic void doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
doPost in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionpublic void doPut(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
doPut in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionpublic void doDelete(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
doDelete in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionpublic void doOptions(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
doOptions in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionpublic void doTrace(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
doTrace in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionCopyright © 2020. All Rights Reserved.