org.glassfish.jersey.server.model
Class InflectorBasedResourceMethod

java.lang.Object
  extended by org.glassfish.jersey.server.model.AbstractResourceMethod
      extended by org.glassfish.jersey.server.model.InflectorBasedResourceMethod
All Implemented Interfaces:
ConsumesProducesEnabledComponent, ResourceModelComponent, SuspendableComponent

public class InflectorBasedResourceMethod
extends AbstractResourceMethod

Models a dynamically created resource method. Such a method is defined with a provided Inflector instance. The Inflector should consume the incoming request and provide a response back.

Author:
Jakub Podlesak (jakub.podlesak at oracle.com)

Constructor Summary
InflectorBasedResourceMethod(ResourceClass resource, String httpMethod, List<javax.ws.rs.core.MediaType> inputMediaTypes, List<javax.ws.rs.core.MediaType> outputMediaTypes, Inflector<javax.ws.rs.core.Request,javax.ws.rs.core.Response> inflector)
          Constructs a new instance bound to the given resource class.
 
Method Summary
 void accept(ResourceModelVisitor visitor)
          A component should call the visitor back with an appropriate visitor interface method to give it a chance to process.
 Inflector<javax.ws.rs.core.Request,javax.ws.rs.core.Response> getInflector()
          Getter for inflector.
 
Methods inherited from class org.glassfish.jersey.server.model.AbstractResourceMethod
areInputTypesDeclared, areOutputTypesDeclared, declareSuspend, getComponents, getDeclaringResource, getHttpMethod, getSupportedInputTypes, getSupportedOutputTypes, getSuspendTimeout, getSuspendTimeoutUnit, isSuspendDeclared, setAreInputTypesDeclared, setAreOutputTypesDeclared, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InflectorBasedResourceMethod

public InflectorBasedResourceMethod(ResourceClass resource,
                                    String httpMethod,
                                    List<javax.ws.rs.core.MediaType> inputMediaTypes,
                                    List<javax.ws.rs.core.MediaType> outputMediaTypes,
                                    Inflector<javax.ws.rs.core.Request,javax.ws.rs.core.Response> inflector)
Constructs a new instance bound to the given resource class. You need to manually add the new instance to the list of existing resource methods.

Parameters:
resource - where this new method should be bound
httpMethod - (e.g. "GET", "PUT", ...)
inputMediaTypes - non-null list of supported input media types, should be empty if media types are not specified explicitly
outputMediaTypes - non-null list of supported output media types, should be empty if media types are not specified explicitly
inflector -
See Also:
Inflector
Method Detail

getInflector

public Inflector<javax.ws.rs.core.Request,javax.ws.rs.core.Response> getInflector()
Getter for inflector.

Returns:
encapsulated inflector

accept

public void accept(ResourceModelVisitor visitor)
Description copied from interface: ResourceModelComponent
A component should call the visitor back with an appropriate visitor interface method to give it a chance to process.

Parameters:
visitor - resource model visitor.


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