com.sun.jersey.server.impl.uri.rules
Class HttpMethodRule
java.lang.Object
com.sun.jersey.server.impl.uri.rules.HttpMethodRule
- All Implemented Interfaces:
- UriRule
public final class HttpMethodRule
- extends java.lang.Object
- implements UriRule
The rule for accepting an HTTP method.
- Author:
- [email protected]
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CONTENT_TYPE_PROPERTY
public static final java.lang.String CONTENT_TYPE_PROPERTY
- See Also:
- Constant Field Values
HttpMethodRule
public HttpMethodRule(java.util.Map<java.lang.String,java.util.List<ResourceMethod>> methods,
DispatchingListener dispatchingListener)
HttpMethodRule
public HttpMethodRule(java.util.Map<java.lang.String,java.util.List<ResourceMethod>> methods,
boolean isSubResource,
DispatchingListener dispatchingListener)
accept
public boolean accept(java.lang.CharSequence path,
java.lang.Object resource,
UriRuleContext context)
- Description copied from interface:
UriRule
- Accept the rule.
- Specified by:
accept
in interface UriRule
- Parameters:
path
- the URI pathresource
- the current resource instancecontext
- the rule context
- Returns:
- if true then the rule was accepted, if false then the rule was
not accepted.
getSpecificAcceptableMediaTypes
public static java.util.List<MediaType> getSpecificAcceptableMediaTypes(java.util.List<MediaType> acceptableMediaType,
java.util.List<? extends MediaType> priorityMediaTypes)
- Get a list of media types that are acceptable for the response.
- Parameters:
acceptableMediaType
- the list of acceptable media types.priorityMediaTypes
- the list of media types that take priority.
- Returns:
- a singleton list containing the most specific media
type for first media type in
priorityMediaTypes that
is compatible with an acceptable media type, otherwise the
list of all acceptable media type is returned.
Copyright © 2013 Oracle Corporation. All Rights Reserved.