org.glassfish.jersey.server.internal.routing
Interface RoutingContext


public interface RoutingContext

Jersey request matching and routing context.

Author:
Marek Potociar (marek.potociar at oracle.com)

Method Summary
 java.lang.String getFinalMatchingGroup()
          Get the final matching group of the last successful request URI routing pattern match result.
 Inflector<JerseyContainerRequestContext,JerseyContainerResponseContext> getInflector()
          Get the matched request to response data inflector if present, or null otherwise.
 java.util.List<java.util.regex.MatchResult> getMatchedResults()
          Get a read-only list of match results for matched request URI routing patterns.
 java.lang.Object peekMatchedResource()
          Peek the last resource object that successfully matched the request URI.
 java.util.regex.MatchResult peekMatchResult()
          Peek at the last successful request URI routing pattern match result.
 void pushLeftHandPath()
          Add currently matched left-hand side part of request path to the list of matched paths returned by UriInfo.getMatchedURIs().
 void pushMatchedResource(java.lang.Object resource)
          Push the resource that matched the request URI.
 void pushMatchResult(java.util.regex.MatchResult matchResult)
          Push the result of the successful request URI routing pattern match.
 void pushTemplate(UriTemplate template)
          Push matched request URI routing pattern URI template.
 void setInflector(Inflector<JerseyContainerRequestContext,JerseyContainerResponseContext> inflector)
          Set the matched request to response inflector.
 

Method Detail

pushMatchResult

void pushMatchResult(java.util.regex.MatchResult matchResult)
Push the result of the successful request URI routing pattern match.

Parameters:
matchResult - successful request URI routing pattern match result.

pushMatchedResource

void pushMatchedResource(java.lang.Object resource)
Push the resource that matched the request URI.

Parameters:
resource - instance of the resource that matched the request URI.

peekMatchedResource

java.lang.Object peekMatchedResource()
Peek the last resource object that successfully matched the request URI.

Returns:
last resource matched as previously set by pushMatchedResource(java.lang.Object)

peekMatchResult

java.util.regex.MatchResult peekMatchResult()
Peek at the last successful request URI routing pattern match result.

Returns:
last successful request URI routing pattern match result.

pushTemplate

void pushTemplate(UriTemplate template)
Push matched request URI routing pattern URI template.

Parameters:
template - URI template of the matched request URI routing pattern.

getFinalMatchingGroup

java.lang.String getFinalMatchingGroup()
Get the final matching group of the last successful request URI routing pattern match result. Also known as right-hand path.

May be empty but is never null.

Returns:
final matching group of the last successful request URI routing pattern match result.

getMatchedResults

java.util.List<java.util.regex.MatchResult> getMatchedResults()
Get a read-only list of match results for matched request URI routing patterns. Entries are ordered in reverse request URI matching order, with the root request URI routing pattern match result last.

Returns:
a read-only reverse list of request URI routing pattern match results.

pushLeftHandPath

void pushLeftHandPath()
Add currently matched left-hand side part of request path to the list of matched paths returned by UriInfo.getMatchedURIs().

Left-hand side request path is the request path excluding the suffix part of the path matched by the final matching group of the last successful request URI routing pattern.


setInflector

void setInflector(Inflector<JerseyContainerRequestContext,JerseyContainerResponseContext> inflector)
Set the matched request to response inflector. This method can be used in a non-terminal stage to set the inflector that can be retrieved and processed by a subsequent stage.

Parameters:
inflector - matched request to response inflector.

getInflector

Inflector<JerseyContainerRequestContext,JerseyContainerResponseContext> getInflector()
Get the matched request to response data inflector if present, or null otherwise.

Returns:
matched request to response inflector, or null if not available.


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.