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

Enclosing class:
RouterModule

public static interface RouterModule.RoutingContext


Method Summary
 javax.ws.rs.core.MediaType getEffectiveAcceptableType()
          Get the effective content type of the response calculated from the request Accept header values and @Consumes value of the matched resource method.
 String getFinalMatchingGroup()
          Get the final matching group of the last successful request URI routing pattern match result.
 List<MatchResult> getMatchedResults()
          Get a read-only list of match results for matched request URI routing patterns.
 Annotation[] getResponseMethodAnnotations()
          Get the annotations on the method ultimately used to process the request.
 Type getResponseMethodType()
          Get the response type of the method ultimately used to process the request.
 Object peekMatchedResource()
          Peek the last resource object that successfully matched the request URI.
 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(Object resource)
          Push the resource that matched the request URI.
 void pushMatchResult(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 setEffectiveAcceptableType(javax.ws.rs.core.MediaType type)
          Set the effective content type of the response calculated from the request Accept header values and @Consumes value of the matched resource method.
 void setResponseMethodAnnotations(Annotation[] annotations)
          Set the annotations on the method ultimately used to process the request.
 void setResponseMethodType(Type responseType)
          Set the response type of the method ultimately used to process the request.
 

Method Detail

pushMatchResult

void pushMatchResult(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(Object resource)
Push the resource that matched the request URI.

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

peekMatchedResource

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

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

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

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

getMatchedResults

List<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.


getEffectiveAcceptableType

@Nullable
javax.ws.rs.core.MediaType getEffectiveAcceptableType()
Get the effective content type of the response calculated from the request Accept header values and @Consumes value of the matched resource method. May return null if no method was yet matched.

Returns:
effective accepted media type. May return null if no resource method was yet matched.

setEffectiveAcceptableType

void setEffectiveAcceptableType(@Nonnull
                                javax.ws.rs.core.MediaType type)
                                throws NullPointerException
Set the effective content type of the response calculated from the request Accept header values and @Consumes value of the matched resource method. The input value must not be null otherwise a NullPointerException is thrown.

Parameters:
type - new effective accepted media type.
Throws:
NullPointerException - in case the input parameter is null.

setResponseMethodType

void setResponseMethodType(Type responseType)
                           throws NullPointerException
Set the response type of the method ultimately used to process the request.

Parameters:
responseType -
Throws:
NullPointerException - in case the input parameter is null.

getResponseMethodType

Type getResponseMethodType()
Get the response type of the method ultimately used to process the request.

Returns:
processing method response type.

setResponseMethodAnnotations

void setResponseMethodAnnotations(Annotation[] annotations)
                                  throws NullPointerException
Set the annotations on the method ultimately used to process the request.

Parameters:
annotations -
Throws:
NullPointerException - in case the input parameter is null.

getResponseMethodAnnotations

Annotation[] getResponseMethodAnnotations()
Get the annotations on the method ultimately used to process the request.

Returns:
processing method annotations.


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