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

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

Introduction

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

Prototype

ResourceDescription getDescription();

Source Link

Document

Returns the resource's description.

Usage

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

private Descriptor buildCollectionResourceDescriptor(Class<?> type, RootResourceInformation resourceInformation,
        Descriptor representationDescriptor, HttpMethod method) {

    ResourceMetadata metadata = associations.getMetadataFor(type);

    List<Descriptor> nestedDescriptors = new ArrayList<Descriptor>();
    nestedDescriptors.addAll(getPaginationDescriptors(type, method));
    nestedDescriptors.addAll(getProjectionDescriptor(type, method));

    Type descriptorType = getType(method);
    return descriptor().//
            id(prefix(method).concat(metadata.getRel())).//
            name(metadata.getRel()).//
            type(descriptorType).//
            doc(getDocFor(metadata.getDescription())).//
            rt("#" + representationDescriptor.getId()).//
            descriptors(nestedDescriptors).build();
}