Example usage for org.springframework.data.rest.core.mapping ParameterMetadata getDescription

List of usage examples for org.springframework.data.rest.core.mapping ParameterMetadata getDescription

Introduction

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

Prototype

public ResourceDescription getDescription() 

Source Link

Document

Returns the description for the method parameter.

Usage

From source file:org.springframework.data.rest.webmvc.alps.RootResourceInformationToAlpsDescriptorConverter.java

private Collection<Descriptor> buildSearchResourceDescriptors(PersistentEntity<?, ?> entity) {

    ResourceMetadata metadata = associations.getMetadataFor(entity.getType());
    List<Descriptor> descriptors = new ArrayList<Descriptor>();

    for (MethodResourceMapping methodMapping : metadata.getSearchResourceMappings()) {

        List<Descriptor> parameterDescriptors = new ArrayList<Descriptor>();

        for (ParameterMetadata parameterMetadata : methodMapping.getParametersMetadata()) {

            parameterDescriptors.add(//
                    descriptor().//
                            name(parameterMetadata.getName()).//
                            doc(getDocFor(parameterMetadata.getDescription())).//
                            type(Type.SEMANTIC)//
                            .build());/*from   w ww  . j av a 2  s .  c  o  m*/
        }

        descriptors.add(descriptor().//
                type(Type.SAFE).//
                name(methodMapping.getRel()).//
                descriptors(parameterDescriptors).//
                build());
    }

    return descriptors;
}