org.codehaus.enunciate.contract.jaxrs
Class ResourceMethod

java.lang.Object
  extended by net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration
      extended by net.sf.jelly.apt.decorations.declaration.DecoratedMemberDeclaration
          extended by net.sf.jelly.apt.decorations.declaration.DecoratedExecutableDeclaration
              extended by net.sf.jelly.apt.decorations.declaration.DecoratedMethodDeclaration
                  extended by org.codehaus.enunciate.contract.jaxrs.ResourceMethod
All Implemented Interfaces:
com.sun.mirror.declaration.Declaration, com.sun.mirror.declaration.ExecutableDeclaration, com.sun.mirror.declaration.MemberDeclaration, com.sun.mirror.declaration.MethodDeclaration

public class ResourceMethod
extends net.sf.jelly.apt.decorations.declaration.DecoratedMethodDeclaration

A JAX-RS resource method.

Author:
Ryan Heaton

Field Summary
 
Fields inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedMethodDeclaration
INHERITDOC_PATTERN
 
Fields inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedExecutableDeclaration
paramsComments, throwsComments
 
Fields inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration
delegate, javaDoc
 
Constructor Summary
ResourceMethod(com.sun.mirror.declaration.MethodDeclaration delegate, Resource parent)
           
 
Method Summary
 java.util.List<ResourceMethodMediaType> getApplicableMediaTypes()
          The applicable media types for this resource.
 java.util.Set<java.lang.String> getConsumesMime()
          The MIME types that are consumed by this method.
 java.util.List<ResourceEntityParameter> getDeclaredEntityParameters()
          The entity parameters that were declared.
 ResourceEntityParameter getEntityParameter()
          The entity parameter.
 java.lang.String getFullpath()
          Builds the full URI path to this resource method.
 java.util.Set<java.lang.String> getHttpMethods()
          The HTTP methods for invoking the method.
 java.util.Map<java.lang.String,java.lang.Object> getMetaData()
          The metadata associated with this resource.
 Resource getParent()
          The resource that holds this resource method.
 java.util.Set<java.lang.String> getProducesMime()
          The MIME types that are produced by this method.
 ResourceRepresentationMetadata getRepresentationMetadata()
          The output payload for this resource.
 java.util.List<ResourceParameter> getResourceParameters()
          The list of resource parameters that this method requires to be invoked.
 java.lang.String getServletPattern()
          The servlet pattern that can be applied to access this resource method.
 java.util.List<? extends ResponseCode> getStatusCodes()
          The potential status codes.
 java.lang.String getSubpath()
          The subpath for this resource method, if it exists.
protected  ResourceEntityParameter loadEntityParameter(ResourceMethodSignature signatureOverride)
          Loads the specified entity parameter according to the method signature override.
protected  ResourceRepresentationMetadata loadOutputPayload(ResourceMethodSignature signatureOverride)
          Loads the explicit output payload.
protected  java.util.List<ResourceParameter> loadResourceParameters(ResourceMethodSignature signatureOverride)
          Loads the overridden resource parameter values.
 void putMetaData(java.lang.String name, java.lang.Object data)
          Put metadata associated with this resource.
protected  java.lang.String scrubParamNames(java.lang.String subpath)
          Scrubs the path parameters names from the specified subpath.
 
Methods inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedMethodDeclaration
accept, commentNeedsReplacement, constructJavaDoc, getPropertyName, getReturnType, isGetter, isSetter
 
Methods inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedExecutableDeclaration
getFormalTypeParameters, getParameters, getThrownTypes, isVarArgs, parseParamComments
 
Methods inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedMemberDeclaration
getDeclaringType
 
Methods inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration
equals, getAnnotation, getAnnotationMirrors, getAnnotations, getDelegate, getDocComment, getDocValue, getJavaDoc, getModifiers, getPosition, getSimpleName, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.mirror.declaration.ExecutableDeclaration
getFormalTypeParameters, getParameters, getThrownTypes, isVarArgs
 
Methods inherited from interface com.sun.mirror.declaration.MemberDeclaration
getDeclaringType
 
Methods inherited from interface com.sun.mirror.declaration.Declaration
equals, getAnnotation, getAnnotationMirrors, getDocComment, getModifiers, getPosition, getSimpleName
 

Constructor Detail

ResourceMethod

public ResourceMethod(com.sun.mirror.declaration.MethodDeclaration delegate,
                      Resource parent)
Method Detail

loadOutputPayload

protected ResourceRepresentationMetadata loadOutputPayload(ResourceMethodSignature signatureOverride)
Loads the explicit output payload.

Parameters:
signatureOverride - The method signature override.
Returns:
The output payload (explicit in the signature override.

loadResourceParameters

protected java.util.List<ResourceParameter> loadResourceParameters(ResourceMethodSignature signatureOverride)
Loads the overridden resource parameter values.

Parameters:
signatureOverride - The signature override.
Returns:
The explicit resource parameters.

loadEntityParameter

protected ResourceEntityParameter loadEntityParameter(ResourceMethodSignature signatureOverride)
Loads the specified entity parameter according to the method signature override.

Parameters:
signatureOverride - The signature override.
Returns:
The resource entity parameter.

getHttpMethods

public java.util.Set<java.lang.String> getHttpMethods()
The HTTP methods for invoking the method.

Returns:
The HTTP methods for invoking the method.

getFullpath

public java.lang.String getFullpath()
Builds the full URI path to this resource method.

Returns:
the full URI path to this resource method.

getServletPattern

public java.lang.String getServletPattern()
The servlet pattern that can be applied to access this resource method.

Returns:
The servlet pattern that can be applied to access this resource method.

scrubParamNames

protected java.lang.String scrubParamNames(java.lang.String subpath)
Scrubs the path parameters names from the specified subpath.

Parameters:
subpath - The subpath.
Returns:
The scrubbed path.

getSubpath

public java.lang.String getSubpath()
The subpath for this resource method, if it exists.

Returns:
The subpath for this resource method, if it exists.

getParent

public Resource getParent()
The resource that holds this resource method.

Returns:
The resource that holds this resource method.

getConsumesMime

public java.util.Set<java.lang.String> getConsumesMime()
The MIME types that are consumed by this method.

Returns:
The MIME types that are consumed by this method.

getProducesMime

public java.util.Set<java.lang.String> getProducesMime()
The MIME types that are produced by this method.

Returns:
The MIME types that are produced by this method.

getResourceParameters

public java.util.List<ResourceParameter> getResourceParameters()
The list of resource parameters that this method requires to be invoked.

Returns:
The list of resource parameters that this method requires to be invoked.

getEntityParameter

public ResourceEntityParameter getEntityParameter()
The entity parameter.

Returns:
The entity parameter, or null if none.

getDeclaredEntityParameters

public java.util.List<ResourceEntityParameter> getDeclaredEntityParameters()
The entity parameters that were declared. According to JAX-RS, there should be only one for now.

Returns:
The entity parameters that were declared.

getApplicableMediaTypes

public java.util.List<ResourceMethodMediaType> getApplicableMediaTypes()
The applicable media types for this resource.

Returns:
The applicable media types for this resource.

getRepresentationMetadata

public ResourceRepresentationMetadata getRepresentationMetadata()
The output payload for this resource.

Returns:
The output payload for this resource.

getStatusCodes

public java.util.List<? extends ResponseCode> getStatusCodes()
The potential status codes.

Returns:
The potential status codes.

getMetaData

public java.util.Map<java.lang.String,java.lang.Object> getMetaData()
The metadata associated with this resource.

Returns:
The metadata associated with this resource.

putMetaData

public void putMetaData(java.lang.String name,
                        java.lang.Object data)
Put metadata associated with this resource.

Parameters:
name - The name of the metadata.
data - The data.