org.codehaus.enunciate.contract.jaxrs
Class Resource

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.DecoratedTypeDeclaration
              extended by org.codehaus.enunciate.contract.jaxrs.Resource
All Implemented Interfaces:
com.sun.mirror.declaration.Declaration, com.sun.mirror.declaration.MemberDeclaration, com.sun.mirror.declaration.TypeDeclaration
Direct Known Subclasses:
RootResource, SubResource

public abstract class Resource
extends net.sf.jelly.apt.decorations.declaration.DecoratedTypeDeclaration

A JAX-RS resource.

Author:
Ryan Heaton

Field Summary
 
Fields inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration
delegate, javaDoc
 
Constructor Summary
Resource(com.sun.mirror.declaration.TypeDeclaration delegate)
           
 
Method Summary
 java.util.Set<java.lang.String> getConsumesMime()
          The MIME types that the methods on this resource consumes (possibly overridden).
abstract  Resource getParent()
          The parent resource.
abstract  java.lang.String getPath()
          The path to this resource.
 java.util.Set<java.lang.String> getProducesMime()
          The MIME types that the methods on this resource consumes (possibly overridden).
 java.util.List<SubResourceLocator> getResourceLocators()
          The resource locators.
 java.util.List<ResourceMethod> getResourceMethods()
          The resource methods.
 java.util.List<ResourceMethod> getResourceMethods(boolean loadDescendants)
          The resource methods.
protected  java.util.List<ResourceMethod> getResourceMethods(com.sun.mirror.declaration.TypeDeclaration delegate)
          Get all the resource methods for the specified type.
 java.util.List<ResourceParameter> getResourceParameters()
          The resource parameters.
protected  java.util.List<ResourceParameter> getResourceParameters(com.sun.mirror.declaration.TypeDeclaration delegate)
          Get the resource parameters for the specified delegate.
protected  java.util.List<SubResourceLocator> getSubresourceLocators(com.sun.mirror.declaration.TypeDeclaration delegate)
          Get the sub-resource locators for the specified type.
protected  boolean isOverridden(net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration method, java.util.ArrayList<? extends net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration> resourceMethods)
          Whether the specified method is overridden by any of the methods in the specified list.
 
Methods inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedTypeDeclaration
accept, getFields, getFormalTypeParameters, getMethods, getNestedTypes, getPackage, getProperties, getQualifiedName, getSuperinterfaces, isAnnotatedType, isClass, isEnum, isInterface, isPaired
 
Methods inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedMemberDeclaration
getDeclaringType
 
Methods inherited from class net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration
constructJavaDoc, 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.MemberDeclaration
getDeclaringType
 
Methods inherited from interface com.sun.mirror.declaration.Declaration
equals, getAnnotation, getAnnotationMirrors, getDocComment, getModifiers, getPosition, getSimpleName
 

Constructor Detail

Resource

public Resource(com.sun.mirror.declaration.TypeDeclaration delegate)
Method Detail

getSubresourceLocators

protected java.util.List<SubResourceLocator> getSubresourceLocators(com.sun.mirror.declaration.TypeDeclaration delegate)
Get the sub-resource locators for the specified type.

Parameters:
delegate - The type.
Returns:
The sub-resource locators.

getResourceMethods

protected java.util.List<ResourceMethod> getResourceMethods(com.sun.mirror.declaration.TypeDeclaration delegate)
Get all the resource methods for the specified type.

Parameters:
delegate - The type.
Returns:
The resource methods.

getResourceParameters

protected java.util.List<ResourceParameter> getResourceParameters(com.sun.mirror.declaration.TypeDeclaration delegate)
Get the resource parameters for the specified delegate.

Parameters:
delegate - The delegate.
Returns:
The resource parameters.

isOverridden

protected boolean isOverridden(net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration method,
                               java.util.ArrayList<? extends net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration> resourceMethods)
Whether the specified method is overridden by any of the methods in the specified list.

Parameters:
method - The method.
resourceMethods - The method list.
Returns:
If the methdo is overridden by any of the methods in the list.

getPath

public abstract java.lang.String getPath()
The path to this resource.

Returns:
The path to this resource.

getParent

public abstract Resource getParent()
The parent resource.

Returns:
The parent resource, or null if this is a root resource.

getConsumesMime

public java.util.Set<java.lang.String> getConsumesMime()
The MIME types that the methods on this resource consumes (possibly overridden).

Returns:
The MIME types that the methods on this resource consumes.

getProducesMime

public java.util.Set<java.lang.String> getProducesMime()
The MIME types that the methods on this resource consumes (possibly overridden).

Returns:
The MIME types that the methods on this resource consumes.

getResourceParameters

public java.util.List<ResourceParameter> getResourceParameters()
The resource parameters.

Returns:
The resource parameters.

getResourceMethods

public java.util.List<ResourceMethod> getResourceMethods()
The resource methods.

Returns:
The resource methods.

getResourceMethods

public java.util.List<ResourceMethod> getResourceMethods(boolean loadDescendants)
The resource methods.

Parameters:
loadDescendants - Whether to include the resource methods of all sub-resources.
Returns:
The resource methods.

getResourceLocators

public java.util.List<SubResourceLocator> getResourceLocators()
The resource locators.

Returns:
The resource locators.