public abstract class MappingHandler extends java.lang.Object implements MethodHandler
| Constructor and Description |
|---|
MappingHandler(java.lang.Object host,
Mapping mapping,
Addition addition,
CrossOrigin crossOrigin) |
| Modifier and Type | Method and Description |
|---|---|
Addition |
getAddition()
Get addition configuration, addition provides some added value.
|
CrossOrigin |
getCrossOrigin()
Get cross origin information.
|
java.lang.String |
getETag(HttpRequest request)
Get the
ETag requesting the specified resource. |
protected java.lang.Object |
getHost() |
long |
getLastModified(HttpRequest request)
The return value will be sent to the HTTP client as
Last-Modified header, and compared with If-Modified-Since headers that the client sends back. |
Mapping |
getMapping()
Get mapping configuration, mapping provides all the annotation information for this method.
|
protected java.util.Map<java.lang.String,java.lang.String> |
getPathVariable(java.lang.String httpPath)
Get the path to match the request.
|
View |
handle(HttpRequest request,
HttpResponse response)
Use the given handler to handle this request.
|
protected abstract View |
onHandle(HttpRequest request,
HttpResponse response) |
public MappingHandler(java.lang.Object host,
Mapping mapping,
Addition addition,
CrossOrigin crossOrigin)
public java.lang.String getETag(HttpRequest request) throws java.lang.Throwable
ETagETag requesting the specified resource.
Can simply return null if there's no support.
public long getLastModified(HttpRequest request) throws java.lang.Throwable
LastModifiedLast-Modified header, and compared with If-Modified-Since headers that the client sends back. The content will only get regenerated if there has been a
modification.getLastModified in interface LastModifiedrequest - current requestjava.lang.Throwablepublic Addition getAddition()
MethodHandlergetAddition in interface MethodHandlerAddition.public CrossOrigin getCrossOrigin()
MethodHandlergetCrossOrigin in interface MethodHandlerCrossOriginpublic Mapping getMapping()
MethodHandlergetMapping in interface MethodHandlerMapping.protected java.lang.Object getHost()
protected java.util.Map<java.lang.String,java.lang.String> getPathVariable(java.lang.String httpPath)
httpPath - http path.public View handle(HttpRequest request, HttpResponse response) throws java.lang.Throwable
RequestHandlerhandle in interface RequestHandlerrequest - current request.response - current response.java.lang.Throwableprotected abstract View onHandle(HttpRequest request, HttpResponse response) throws java.lang.Throwable
java.lang.Throwable