com.mangofactory.swagger.core
Class ClassOrApiAnnotationResourceGrouping

java.lang.Object
  extended by com.mangofactory.swagger.core.ClassOrApiAnnotationResourceGrouping
All Implemented Interfaces:
ResourceGroupingStrategy

@Component
public class ClassOrApiAnnotationResourceGrouping
extends java.lang.Object
implements ResourceGroupingStrategy


Constructor Summary
ClassOrApiAnnotationResourceGrouping()
           
 
Method Summary
 java.lang.String getResourceDescription(org.springframework.web.servlet.mvc.method.RequestMappingInfo requestMappingInfo, org.springframework.web.method.HandlerMethod handlerMethod)
          Gets the resource description.
 java.util.Set<ResourceGroup> getResourceGroups(org.springframework.web.servlet.mvc.method.RequestMappingInfo requestMappingInfo, org.springframework.web.method.HandlerMethod handlerMethod)
          Gets the resource group for a particular request mapping.
 java.lang.Integer getResourcePosition(org.springframework.web.servlet.mvc.method.RequestMappingInfo requestMappingInfo, org.springframework.web.method.HandlerMethod handlerMethod)
          Gets the position of the resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassOrApiAnnotationResourceGrouping

public ClassOrApiAnnotationResourceGrouping()
Method Detail

getResourceDescription

public java.lang.String getResourceDescription(org.springframework.web.servlet.mvc.method.RequestMappingInfo requestMappingInfo,
                                               org.springframework.web.method.HandlerMethod handlerMethod)
Description copied from interface: ResourceGroupingStrategy
Gets the resource description. i.e. the top level resource name for a set of api operations as displayed on the main swagger ui page. e.g. 'BusinessApiController' This is typically the class name of the spring controller or value() attribute of any @Api annotations on that controller class

Specified by:
getResourceDescription in interface ResourceGroupingStrategy
Parameters:
requestMappingInfo - request mapping info
handlerMethod - handler method
Returns:
description of the resource

getResourcePosition

public java.lang.Integer getResourcePosition(org.springframework.web.servlet.mvc.method.RequestMappingInfo requestMappingInfo,
                                             org.springframework.web.method.HandlerMethod handlerMethod)
Description copied from interface: ResourceGroupingStrategy
Gets the position of the resource. Typically com.wordnik.swagger.annotations.Api.position

Specified by:
getResourcePosition in interface ResourceGroupingStrategy
Returns:
The numeric position

getResourceGroups

public java.util.Set<ResourceGroup> getResourceGroups(org.springframework.web.servlet.mvc.method.RequestMappingInfo requestMappingInfo,
                                                      org.springframework.web.method.HandlerMethod handlerMethod)
Description copied from interface: ResourceGroupingStrategy
Gets the resource group for a particular request mapping. Typically several requestMappings will live under a particular resource group.

Specified by:
getResourceGroups in interface ResourceGroupingStrategy
Parameters:
requestMappingInfo - request mapping info
handlerMethod - handler method
Returns:
Resource group uris.
See Also:
ApiListingReferenceScanner