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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallowsPutForCreation(Class<?> domainType) Returns whether PUT requests can be used to create new instances of the given domain type.booleanallowsPutForCreation(ResourceMetadata metadata) Returns whether PUT requests can be used to create new instances for the type backing the givenResourceMetadata.Disables the support forHttpMethod.PATCHfor item resources.Disables the ability to create new item resources viaHttpMethod.PUT.Disables the support forHttpMethod.PUTfor item resources.forDomainType(Class<?> type) Returns aExposureConfigurerto allow the registration of type specificExposureConfigurer.AggregateResourceHttpMethodsFilterandExposureConfigurer.AssociationResourceHttpMethodsFilters 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.AggregateResourceHttpMethodsFilterto be used for collection resources.Registers the givenExposureConfigurer.AggregateResourceHttpMethodsFilterto be used for item resources.
-
Constructor Details
-
ExposureConfiguration
public ExposureConfiguration()
-
-
Method Details
-
withCollectionExposure
public ExposureConfiguration withCollectionExposure(ExposureConfigurer.AggregateResourceHttpMethodsFilter filter) Description copied from interface:ExposureConfigurerRegisters the givenExposureConfigurer.AggregateResourceHttpMethodsFilterto be used for collection resources.- Specified by:
withCollectionExposurein interfaceExposureConfigurer- Parameters:
filter- must not be null.- Returns:
-
withItemExposure
public ExposureConfiguration withItemExposure(ExposureConfigurer.AggregateResourceHttpMethodsFilter filter) Description copied from interface:ExposureConfigurerRegisters the givenExposureConfigurer.AggregateResourceHttpMethodsFilterto be used for item resources.- Specified by:
withItemExposurein interfaceExposureConfigurer- Returns:
-
withAssociationExposure
public ExposureConfiguration withAssociationExposure(ExposureConfigurer.AssociationResourceHttpMethodsFilter filter) Description copied from interface:ExposureConfigurerRegisters the givenExposureConfigurer.AssociationResourceHttpMethodsFilter.- Specified by:
withAssociationExposurein interfaceExposureConfigurer- Returns:
-
disablePutForCreation
Description copied from interface:ExposureConfigurerDisables the ability to create new item resources viaHttpMethod.PUT.- Specified by:
disablePutForCreationin interfaceExposureConfigurer- Returns:
-
forDomainType
Returns aExposureConfigurerto allow the registration of type specificExposureConfigurer.AggregateResourceHttpMethodsFilterandExposureConfigurer.AssociationResourceHttpMethodsFilters 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.PUTfor item resources.- Returns:
-
disablePatchOnItemResources
Disables the support forHttpMethod.PATCHfor 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:
-