Example usage for org.springframework.data.rest.core.config ProjectionDefinitionConfiguration hasProjectionFor

List of usage examples for org.springframework.data.rest.core.config ProjectionDefinitionConfiguration hasProjectionFor

Introduction

In this page you can find the example usage for org.springframework.data.rest.core.config ProjectionDefinitionConfiguration hasProjectionFor.

Prototype

@Override
    public boolean hasProjectionFor(Class<?> sourceType) 

Source Link

Usage

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

private List<Descriptor> getProjectionDescriptor(Class<?> type, HttpMethod method) {

    if (!Type.SAFE.equals(getType(method))) {
        return Collections.emptyList();
    }//from w  w  w  .  j a  va 2s  .c  o  m

    ProjectionDefinitionConfiguration projectionConfiguration = configuration.getProjectionConfiguration();

    return projectionConfiguration.hasProjectionFor(type)
            ? Arrays.asList(buildProjectionDescriptor(associations.getMetadataFor(type)))
            : Collections.<Descriptor>emptyList();
}