public class RepositoryRestConfiguration extends Object
Constructor and Description |
---|
RepositoryRestConfiguration() |
Modifier and Type | Method and Description |
---|---|
RepositoryRestConfiguration |
exposeIdsFor(Class<?>... domainTypes)
Set the list of domain types for which we will expose the ID value as a normal property.
|
ResourceMapping |
findRepositoryMappingForPath(String path) |
URI |
getBaseUri()
The base URI against which the exporter should calculate its links.
|
MediaType |
getDefaultMediaType()
Get the
MediaType to use as a default when none is specified. |
int |
getDefaultPageSize()
Get the default size of
Pageable s. |
ResourceMappingConfiguration |
getDomainTypesResourceMappingConfiguration()
Get the
ResourceMappingConfiguration that is currently configured. |
String |
getLimitParamName()
Get the name of the URL query string parameter that indicates how many results to return at once.
|
int |
getMaxPageSize()
Get the maximum size of pages.
|
String |
getPageParamName()
Get the name of the URL query string parameter that indicates what page to return.
|
ResourceMapping |
getResourceMappingForDomainType(Class<?> domainType)
Get the
ResourceMapping for a specific domain type. |
ResourceMapping |
getResourceMappingForRepository(Class<?> repositoryInterface)
Get the
ResourceMapping for a specific repository interface. |
String |
getSortParamName()
Get the name of the URL query string parameter that indicates what direction to sort results.
|
boolean |
hasResourceMappingForDomainType(Class<?> domainType)
Whether there is a
ResourceMapping for the given domain type. |
boolean |
hasResourceMappingForRepository(Class<?> repositoryInterface)
Whether there is a
ResourceMapping configured for this Repository class. |
boolean |
isIdExposedFor(Class<?> domainType)
Should we expose the ID property for this domain type?
|
boolean |
isReturnBodyOnCreate()
Whether to return a response body after creating an entity.
|
boolean |
isReturnBodyOnUpdate()
Whether to return a response body after updating an entity.
|
RepositoryRestConfiguration |
setBaseUri(URI baseUri)
The base URI against which the exporter should calculate its links.
|
RepositoryRestConfiguration |
setDefaultMediaType(MediaType defaultMediaType)
Set the
MediaType to use as a default when none is specified. |
RepositoryRestConfiguration |
setDefaultPageSize(int defaultPageSize)
Set the default size of
Pageable s. |
RepositoryRestConfiguration |
setLimitParamName(String limitParamName)
Set the name of the URL query string parameter that indicates how many results to return at once.
|
RepositoryRestConfiguration |
setMaxPageSize(int maxPageSize)
Set the maximum size of pages.
|
RepositoryRestConfiguration |
setPageParamName(String pageParamName)
Set the name of the URL query string parameter that indicates what page to return.
|
ResourceMapping |
setResourceMappingForDomainType(Class<?> domainType)
Start configuration a
ResourceMapping for a specific domain type. |
ResourceMapping |
setResourceMappingForRepository(Class<?> repositoryInterface)
Start configuration a
ResourceMapping for a specific repository interface. |
RepositoryRestConfiguration |
setReturnBodyOnCreate(boolean returnBodyOnCreate)
Set whether to return a response body after creating an entity.
|
RepositoryRestConfiguration |
setReturnBodyOnUpdate(boolean returnBodyOnUpdate)
Sets whether to return a response body after updating an entity.
|
RepositoryRestConfiguration |
setSortParamName(String sortParamName)
Set the name of the URL query string parameter that indicates what direction to sort results.
|
public URI getBaseUri()
public RepositoryRestConfiguration setBaseUri(URI baseUri)
baseUri
- The base URI.public int getDefaultPageSize()
Pageable
s. Default is 20.public RepositoryRestConfiguration setDefaultPageSize(int defaultPageSize)
Pageable
s.defaultPageSize
- The default page size.public int getMaxPageSize()
public RepositoryRestConfiguration setMaxPageSize(int maxPageSize)
maxPageSize
- Maximum page size.public String getPageParamName()
public RepositoryRestConfiguration setPageParamName(String pageParamName)
pageParamName
- Name of the query parameter used to indicate the page number to return.public String getLimitParamName()
public RepositoryRestConfiguration setLimitParamName(String limitParamName)
limitParamName
- Name of the query parameter used to indicate the maximum number of entries to return at a
time.public String getSortParamName()
public RepositoryRestConfiguration setSortParamName(String sortParamName)
sortParamName
- Name of the query string parameter used to indicate what field to sort on.public MediaType getDefaultMediaType()
MediaType
to use as a default when none is specified.public RepositoryRestConfiguration setDefaultMediaType(MediaType defaultMediaType)
MediaType
to use as a default when none is specified.defaultMediaType
- Default content type if none has been specified.public boolean isReturnBodyOnCreate()
public RepositoryRestConfiguration setReturnBodyOnCreate(boolean returnBodyOnCreate)
returnBodyOnCreate
- true to return a body on create, false otherwise.public boolean isReturnBodyOnUpdate()
public RepositoryRestConfiguration setReturnBodyOnUpdate(boolean returnBodyOnUpdate)
returnBodyOnUpdate
- public ResourceMapping setResourceMappingForDomainType(Class<?> domainType)
ResourceMapping
for a specific domain type.domainType
- The Class
of the domain type to configure a mapping for.ResourceMapping
for configuring how a domain type is mapped.public ResourceMapping getResourceMappingForDomainType(Class<?> domainType)
ResourceMapping
for a specific domain type.domainType
- The Class
of the domain type.ResourceMapping
for that domain type or null if none exists.public boolean hasResourceMappingForDomainType(Class<?> domainType)
ResourceMapping
for the given domain type.domainType
- The domain type to find a ResourceMapping
for.ResourceMapping
exists for this domain class, false otherwise.public ResourceMappingConfiguration getDomainTypesResourceMappingConfiguration()
ResourceMappingConfiguration
that is currently configured.public ResourceMapping setResourceMappingForRepository(Class<?> repositoryInterface)
ResourceMapping
for a specific repository interface.repositoryInterface
- The Class
of the repository interface to configure a mapping for.ResourceMapping
for configuring how a repository interface is mapped.public ResourceMapping getResourceMappingForRepository(Class<?> repositoryInterface)
ResourceMapping
for a specific repository interface.repositoryInterface
- The Class
of the repository interface.ResourceMapping
for that repository interface or null if none exists.public boolean hasResourceMappingForRepository(Class<?> repositoryInterface)
ResourceMapping
configured for this Repository class.repositoryInterface
- public ResourceMapping findRepositoryMappingForPath(String path)
public boolean isIdExposedFor(Class<?> domainType)
domainType
- The domain type we may need to expose the ID for.public RepositoryRestConfiguration exposeIdsFor(Class<?>... domainTypes)
domainTypes
- Array of types to expose IDs for.Copyright © 2011-2013-2014 Pivotal. All Rights Reserved.