Example usage for org.springframework.data.rest.core.mapping MethodResourceMapping getMethod

List of usage examples for org.springframework.data.rest.core.mapping MethodResourceMapping getMethod

Introduction

In this page you can find the example usage for org.springframework.data.rest.core.mapping MethodResourceMapping getMethod.

Prototype

Method getMethod();

Source Link

Document

Returns the Method backing the resource.

Usage

From source file:springfox.documentation.spring.data.rest.EntitySearchRequestTemplate.java

Collection<? extends RequestHandler> operations() {
    List<RequestHandler> requestHandlers = newArrayList();
    boolean collectionHandlerAdded = false;
    for (ResourceMetadata resource : mappings) {
        for (MethodResourceMapping searchResource : resource.getSearchResourceMappings()) {
            EntitySearchRequestHandler handler = new EntitySearchRequestHandler(resolver, requestMapping,
                    new HandlerMethod(searchResource.getMethod().getClass(), searchResource.getMethod()),
                    searchResource, resource);
            if (handler.resourceType() == ResourceType.ITEM || !collectionHandlerAdded) {
                requestHandlers.add(handler);
                if (!collectionHandlerAdded) {
                    collectionHandlerAdded = (handler.resourceType() == ResourceType.COLLECTION);
                }//from   w  ww.j ava 2 s. c om
            }
        }
    }
    return requestHandlers;
}