Class ExposureConfiguration
java.lang.Object
org.springframework.data.rest.core.mapping.ExposureConfiguration
- All Implemented Interfaces:
ExposureConfigurer
Configuration type to register filters customizing the HTTP methods supported. By default, filters registered are
applied globally. Domain type specific filters can be registered via
forDomainType(Class)
. Useful global
shortcuts like disablePutOnItemResources()
do exist as well.- Since:
- 3.1
- Author:
- Oliver Gierke
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.rest.core.mapping.ExposureConfigurer
ExposureConfigurer.AggregateResourceHttpMethodsFilter, ExposureConfigurer.AssociationResourceHttpMethodsFilter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
allowsPutForCreation
(Class<?> domainType) Returns whether PUT requests can be used to create new instances of the given domain type.boolean
allowsPutForCreation
(ResourceMetadata metadata) Returns whether PUT requests can be used to create new instances for the type backing the givenResourceMetadata
.Disables the support forHttpMethod.PATCH
for item resources.Disables the ability to create new item resources viaHttpMethod.PUT
.Disables the support forHttpMethod.PUT
for item resources.forDomainType
(Class<?> type) Returns aExposureConfigurer
to allow the registration of type specificExposureConfigurer.AggregateResourceHttpMethodsFilter
andExposureConfigurer.AssociationResourceHttpMethodsFilter
s which means the configured filters will only be invoked for aggregates of the given type and properties owned by that type respectively.Registers the givenExposureConfigurer.AssociationResourceHttpMethodsFilter
.Registers the givenExposureConfigurer.AggregateResourceHttpMethodsFilter
to be used for collection resources.Registers the givenExposureConfigurer.AggregateResourceHttpMethodsFilter
to be used for item resources.
-
Constructor Details
-
ExposureConfiguration
public ExposureConfiguration()
-
-
Method Details
-
withCollectionExposure
public ExposureConfiguration withCollectionExposure(ExposureConfigurer.AggregateResourceHttpMethodsFilter filter) Description copied from interface:ExposureConfigurer
Registers the givenExposureConfigurer.AggregateResourceHttpMethodsFilter
to be used for collection resources.- Specified by:
withCollectionExposure
in interfaceExposureConfigurer
- Parameters:
filter
- must not be null.- Returns:
-
withItemExposure
public ExposureConfiguration withItemExposure(ExposureConfigurer.AggregateResourceHttpMethodsFilter filter) Description copied from interface:ExposureConfigurer
Registers the givenExposureConfigurer.AggregateResourceHttpMethodsFilter
to be used for item resources.- Specified by:
withItemExposure
in interfaceExposureConfigurer
- Returns:
-
withAssociationExposure
public ExposureConfiguration withAssociationExposure(ExposureConfigurer.AssociationResourceHttpMethodsFilter filter) Description copied from interface:ExposureConfigurer
Registers the givenExposureConfigurer.AssociationResourceHttpMethodsFilter
.- Specified by:
withAssociationExposure
in interfaceExposureConfigurer
- Returns:
-
disablePutForCreation
Description copied from interface:ExposureConfigurer
Disables the ability to create new item resources viaHttpMethod.PUT
.- Specified by:
disablePutForCreation
in interfaceExposureConfigurer
- Returns:
-
forDomainType
Returns aExposureConfigurer
to allow the registration of type specificExposureConfigurer.AggregateResourceHttpMethodsFilter
andExposureConfigurer.AssociationResourceHttpMethodsFilter
s which means the configured filters will only be invoked for aggregates of the given type and properties owned by that type respectively.- Parameters:
type
- must not be null.- Returns:
-
disablePutOnItemResources
Disables the support forHttpMethod.PUT
for item resources.- Returns:
-
disablePatchOnItemResources
Disables the support forHttpMethod.PATCH
for item resources.- Returns:
-
allowsPutForCreation
Returns whether PUT requests can be used to create new instances for the type backing the givenResourceMetadata
.- Parameters:
metadata
- must not be null.- Returns:
-
allowsPutForCreation
Returns whether PUT requests can be used to create new instances of the given domain type.- Parameters:
domainType
- must not be null.- Returns:
-