public final class WebApplicationContext extends Object implements UriRuleContext, ExtendedUriInfo
| Modifier and Type | Field and Description |
|---|---|
static String |
HTTP_METHOD_MATCH_RESOURCE |
| Constructor and Description |
|---|
WebApplicationContext(WebApplicationImpl app,
ContainerRequest request,
ContainerResponse response) |
| Modifier and Type | Method and Description |
|---|---|
WebApplicationContext |
createMatchResourceContext(URI u) |
URI |
getAbsolutePath() |
javax.ws.rs.core.UriBuilder |
getAbsolutePathBuilder() |
URI |
getBaseUri() |
javax.ws.rs.core.UriBuilder |
getBaseUriBuilder() |
ContainerRequest |
getContainerRequest()
Get the container request.
|
ContainerResponse |
getContainerResponse()
Get the container response.
|
Throwable |
getMappedThrowable()
Get the throwable that was mapped to a response.
|
AbstractResourceMethod |
getMatchedMethod()
Get get matched resource method that was invoked.
|
List<Object> |
getMatchedResources() |
List<MatchResult> |
getMatchedResults()
Get a read-only list of
MatchResult for matched resources. |
List<UriTemplate> |
getMatchedTemplates()
Get a read-only list of
UriTemplate for matched resources. |
List<String> |
getMatchedURIs() |
List<String> |
getMatchedURIs(boolean decode) |
MatchResult |
getMatchResult()
Get the match result
|
String |
getPath() |
String |
getPath(boolean decode) |
javax.ws.rs.core.MultivaluedMap<String,String> |
getPathParameters() |
javax.ws.rs.core.MultivaluedMap<String,String> |
getPathParameters(boolean decode) |
List<javax.ws.rs.core.PathSegment> |
getPathSegments() |
List<javax.ws.rs.core.PathSegment> |
getPathSegments(boolean decode) |
List<javax.ws.rs.core.PathSegment> |
getPathSegments(String name)
Get the path segments that contains a template variable.
|
List<javax.ws.rs.core.PathSegment> |
getPathSegments(String name,
boolean decode)
Get the path segments that contains a template variable.
|
Map<String,Object> |
getProperties()
Get the mutable properties.
|
javax.ws.rs.core.MultivaluedMap<String,String> |
getQueryParameters() |
javax.ws.rs.core.MultivaluedMap<String,String> |
getQueryParameters(boolean decode) |
HttpRequestContext |
getRequest()
Get the HTTP request information.
|
URI |
getRequestUri() |
javax.ws.rs.core.UriBuilder |
getRequestUriBuilder() |
Object |
getResource(Class resourceClass)
Get the resource instance from a resource class.
|
HttpResponseContext |
getResponse()
Get the HTTP response information.
|
List<ContainerResponseFilter> |
getResponseFilters() |
UriRules<UriRule> |
getRules(Class resourceClass)
Get the rules for a resource class.
|
ExtendedUriInfo |
getUriInfo()
Get the extended URI information.
|
boolean |
isTracingEnabled()
Check if tracing is enabled.
|
void |
pushContainerResponseFilters(List<ContainerResponseFilter> filters)
Push a list of container response filters to apply after the
container response has been produced.
|
void |
pushMatch(UriTemplate template,
List<String> names)
Push a match.
|
void |
pushMethod(AbstractResourceMethod arm)
Push the matching resource method.
|
void |
pushResource(Object resource)
Push a matching resource.
|
void |
pushRightHandPathLength(int rhpathlen)
Push the right hand path length to calculate the entry for
the list of matching (ancestor) URI paths.
|
void |
setContainerRequest(ContainerRequest request)
Set the container request.
|
void |
setContainerResponse(ContainerResponse response)
Set the container response.
|
void |
setMatchResult(MatchResult matchResult)
Set the match result
|
void |
trace(String message)
Add a trace message.
|
public static final String HTTP_METHOD_MATCH_RESOURCE
public WebApplicationContext(WebApplicationImpl app, ContainerRequest request, ContainerResponse response)
public WebApplicationContext createMatchResourceContext(URI u)
public List<ContainerResponseFilter> getResponseFilters()
public HttpRequestContext getRequest()
HttpContextgetRequest in interface HttpContextpublic HttpResponseContext getResponse()
HttpContextgetResponse in interface HttpContextpublic ExtendedUriInfo getUriInfo()
HttpContextgetUriInfo in interface HttpContextpublic Map<String,Object> getProperties()
HttpContextCare should be taken not to clear the properties or remove properties that are unknown otherwise unspecified behaviour may result.
getProperties in interface HttpContextpublic boolean isTracingEnabled()
TraceableisTracingEnabled in interface Traceablepublic void trace(String message)
Traceable
A trace message will be added if Traceable.isTracingEnabled() returns
true and tracing contraints are satisfied.
public MatchResult getMatchResult()
UriMatchResultContextgetMatchResult in interface UriMatchResultContextpublic void setMatchResult(MatchResult matchResult)
UriMatchResultContextsetMatchResult in interface UriMatchResultContextmatchResult - the match result.public ContainerRequest getContainerRequest()
UriRuleContextgetContainerRequest in interface UriRuleContextpublic void setContainerRequest(ContainerRequest request)
UriRuleContextsetContainerRequest in interface UriRuleContextrequest - the container request.public ContainerResponse getContainerResponse()
UriRuleContextgetContainerResponse in interface UriRuleContextpublic void setContainerResponse(ContainerResponse response)
UriRuleContextsetContainerResponse in interface UriRuleContextresponse - the container response.public void pushContainerResponseFilters(List<ContainerResponseFilter> filters)
UriRuleContextThe list of response filters is processed in reverse order of last to first.
pushContainerResponseFilters in interface UriRuleContextfilters - the list container response filterspublic Object getResource(Class resourceClass)
UriRuleContextgetResource in interface UriRuleContextresourceClass - the resource classpublic UriRules<UriRule> getRules(Class resourceClass)
UriRuleContextgetRules in interface UriRuleContextresourceClass - the resource class that has rulespublic void pushMatch(UriTemplate template, List<String> names)
UriRuleContextpushMatch in interface UriRuleContexttemplate - the matching URI template.names - the parameter names associated with the capturing group
values.public void pushResource(Object resource)
UriRuleContextpushResource in interface UriRuleContextresource - the matching resourcepublic void pushMethod(AbstractResourceMethod arm)
UriRuleContextpushMethod in interface UriRuleContextarm - the matching resource method.public void pushRightHandPathLength(int rhpathlen)
UriRuleContextpushRightHandPathLength in interface UriRuleContextrhpathlen - the right hand lengthpublic URI getBaseUri()
getBaseUri in interface javax.ws.rs.core.UriInfopublic javax.ws.rs.core.UriBuilder getBaseUriBuilder()
getBaseUriBuilder in interface javax.ws.rs.core.UriInfopublic URI getAbsolutePath()
getAbsolutePath in interface javax.ws.rs.core.UriInfopublic javax.ws.rs.core.UriBuilder getAbsolutePathBuilder()
getAbsolutePathBuilder in interface javax.ws.rs.core.UriInfopublic URI getRequestUri()
getRequestUri in interface javax.ws.rs.core.UriInfopublic javax.ws.rs.core.UriBuilder getRequestUriBuilder()
getRequestUriBuilder in interface javax.ws.rs.core.UriInfopublic String getPath()
getPath in interface javax.ws.rs.core.UriInfopublic String getPath(boolean decode)
getPath in interface javax.ws.rs.core.UriInfopublic List<javax.ws.rs.core.PathSegment> getPathSegments()
getPathSegments in interface javax.ws.rs.core.UriInfopublic List<javax.ws.rs.core.PathSegment> getPathSegments(boolean decode)
getPathSegments in interface javax.ws.rs.core.UriInfopublic javax.ws.rs.core.MultivaluedMap<String,String> getQueryParameters()
getQueryParameters in interface javax.ws.rs.core.UriInfopublic javax.ws.rs.core.MultivaluedMap<String,String> getQueryParameters(boolean decode)
getQueryParameters in interface javax.ws.rs.core.UriInfopublic javax.ws.rs.core.MultivaluedMap<String,String> getPathParameters()
getPathParameters in interface javax.ws.rs.core.UriInfopublic javax.ws.rs.core.MultivaluedMap<String,String> getPathParameters(boolean decode)
getPathParameters in interface javax.ws.rs.core.UriInfopublic List<String> getMatchedURIs()
getMatchedURIs in interface javax.ws.rs.core.UriInfopublic List<String> getMatchedURIs(boolean decode)
getMatchedURIs in interface javax.ws.rs.core.UriInfopublic List<Object> getMatchedResources()
getMatchedResources in interface javax.ws.rs.core.UriInfopublic AbstractResourceMethod getMatchedMethod()
ExtendedUriInfogetMatchedMethod in interface ExtendedUriInfopublic Throwable getMappedThrowable()
ExtendedUriInfoA response filter or a message body writer may utilize this method to determine if a resource method was invoked but did not return a response because an exception was thrown from the resource method, or the resource method returned but a response filter threw an exception.
getMappedThrowable in interface ExtendedUriInfoContainerResponse.getMappedThrowable()public List<MatchResult> getMatchedResults()
ExtendedUriInfoMatchResult for matched resources.
Entries are ordered in reverse request URI matching order, with the
root resource match result last.getMatchedResults in interface ExtendedUriInfopublic List<UriTemplate> getMatchedTemplates()
ExtendedUriInfoUriTemplate for matched resources.
Each entry is a URI template that is the value of the
Path that is a partial path that matched a resource
class, a sub-resource method or a sub-resource locator.
Entries are ordered in reverse request URI matching order, with the
root resource URI template last.getMatchedTemplates in interface ExtendedUriInfopublic List<javax.ws.rs.core.PathSegment> getPathSegments(String name)
ExtendedUriInfogetPathSegments(true).getPathSegments in interface ExtendedUriInfoname - the template variable namepublic List<javax.ws.rs.core.PathSegment> getPathSegments(String name, boolean decode)
ExtendedUriInfogetPathSegments in interface ExtendedUriInfoname - the template variable namedecode - controls whether sequences of escaped octets are decoded
(true) or not (false).Copyright © 2014 Oracle Corporation. All rights reserved.