com.sun.jersey.server.impl.model.method
Class ResourceMethod

java.lang.Object
  extended by com.sun.jersey.server.impl.model.method.ResourceMethod
Direct Known Subclasses:
ResourceHeadWrapperMethod, ResourceHttpMethod, ResourceHttpOptionsMethod, ViewResourceMethod

public abstract class ResourceMethod
extends java.lang.Object

Author:
[email protected]

Field Summary
static java.util.Comparator<ResourceMethod> COMPARATOR
          Comparator for resource methods, comparing the consumed and produced media types.
 
Constructor Summary
ResourceMethod(java.lang.String httpMethod, UriTemplate template, java.util.List<? extends MediaType> consumeMime, java.util.List<? extends MediaType> produceMime, boolean isProducesDeclared, RequestDispatcher dispatcher)
           
ResourceMethod(java.lang.String httpMethod, UriTemplate template, java.util.List<? extends MediaType> consumeMime, java.util.List<? extends MediaType> produceMime, boolean isProducesDeclared, RequestDispatcher dispatcher, java.util.List<ContainerRequestFilter> requestFilters, java.util.List<ContainerResponseFilter> responseFilters)
           
 
Method Summary
 boolean consumes(MediaType contentType)
          Ascertain if the method is capable of consuming an entity of a certain media type.
 boolean consumesWild()
           
 AbstractResourceMethod getAbstractResourceMethod()
          Get the abstract resource method.
 java.util.List<? extends MediaType> getConsumes()
           
 RequestDispatcher getDispatcher()
           
 java.lang.String getHttpMethod()
           
 java.util.List<? extends MediaType> getProduces()
           
 java.util.List<ContainerRequestFilter> getRequestFilters()
           
 java.util.List<ContainerResponseFilter> getResponseFilters()
           
 UriTemplate getTemplate()
           
 boolean isProducesDeclared()
           
 boolean mediaEquals(ResourceMethod that)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPARATOR

public static final java.util.Comparator<ResourceMethod> COMPARATOR
Comparator for resource methods, comparing the consumed and produced media types.

Defer to MediaTypes.MEDIA_TYPE_LIST_COMPARATOR for comparing the list of media type that are comsumed and produced. The comparison of consumed media take precedence over the comparison of produced media.

Constructor Detail

ResourceMethod

public ResourceMethod(java.lang.String httpMethod,
                      UriTemplate template,
                      java.util.List<? extends MediaType> consumeMime,
                      java.util.List<? extends MediaType> produceMime,
                      boolean isProducesDeclared,
                      RequestDispatcher dispatcher)

ResourceMethod

public ResourceMethod(java.lang.String httpMethod,
                      UriTemplate template,
                      java.util.List<? extends MediaType> consumeMime,
                      java.util.List<? extends MediaType> produceMime,
                      boolean isProducesDeclared,
                      RequestDispatcher dispatcher,
                      java.util.List<ContainerRequestFilter> requestFilters,
                      java.util.List<ContainerResponseFilter> responseFilters)
Method Detail

getHttpMethod

public final java.lang.String getHttpMethod()

getTemplate

public final UriTemplate getTemplate()

getConsumes

public final java.util.List<? extends MediaType> getConsumes()

getProduces

public final java.util.List<? extends MediaType> getProduces()

isProducesDeclared

public final boolean isProducesDeclared()

getDispatcher

public final RequestDispatcher getDispatcher()

getRequestFilters

public final java.util.List<ContainerRequestFilter> getRequestFilters()

getResponseFilters

public final java.util.List<ContainerResponseFilter> getResponseFilters()

consumes

public final boolean consumes(MediaType contentType)
Ascertain if the method is capable of consuming an entity of a certain media type.

Parameters:
contentType - the media type of the entity that is to be consumed.
Returns:
true if the method is capable of consuming the entity, otherwise false.

consumesWild

public final boolean consumesWild()

mediaEquals

public final boolean mediaEquals(ResourceMethod that)

getAbstractResourceMethod

public AbstractResourceMethod getAbstractResourceMethod()
Get the abstract resource method.

Extending classes may override this method to return an associated abstract resource method.

Returns:
the abstract resource method, otherwise null if there is no abstract resource method assocaiated with the resource method.


Copyright © 2013 Oracle Corporation. All Rights Reserved.