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 Object

Author:
Paul.Sandoz@Sun.Com

Field Summary
static Comparator<ResourceMethod> COMPARATOR
          Comparator for resource methods, comparing the consumed and produced media types.
 
Constructor Summary
ResourceMethod(String httpMethod, UriTemplate template, List<? extends MediaType> consumeMime, List<? extends MediaType> produceMime, boolean isProducesDeclared, RequestDispatcher dispatcher)
           
ResourceMethod(String httpMethod, UriTemplate template, List<? extends MediaType> consumeMime, List<? extends MediaType> produceMime, boolean isProducesDeclared, RequestDispatcher dispatcher, List<ContainerRequestFilter> requestFilters, 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.
 List<? extends MediaType> getConsumes()
           
 RequestDispatcher getDispatcher()
           
 String getHttpMethod()
           
 List<? extends MediaType> getProduces()
           
 List<ContainerRequestFilter> getRequestFilters()
           
 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 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(String httpMethod,
                      UriTemplate template,
                      List<? extends MediaType> consumeMime,
                      List<? extends MediaType> produceMime,
                      boolean isProducesDeclared,
                      RequestDispatcher dispatcher)

ResourceMethod

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

getHttpMethod

public final String getHttpMethod()

getTemplate

public final UriTemplate getTemplate()

getConsumes

public final List<? extends MediaType> getConsumes()

getProduces

public final List<? extends MediaType> getProduces()

isProducesDeclared

public final boolean isProducesDeclared()

getDispatcher

public final RequestDispatcher getDispatcher()

getRequestFilters

public final List<ContainerRequestFilter> getRequestFilters()

getResponseFilters

public final 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.