com.mangofactory.swagger.core
Class SpringGroupingStrategy

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

public class SpringGroupingStrategy
extends java.lang.Object
implements ResourceGroupingStrategy

TODO - fix or remove There are a lot of cases this strategy does not cover. - request mappings of varying path depths, - Paths beginning with path variables - Controllers without top level request mappings


Constructor Summary
SpringGroupingStrategy()
           
 
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

SpringGroupingStrategy

public SpringGroupingStrategy()
Method Detail

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

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