public class HalFormsConfiguration extends Object
HalConfiguration
.Constructor and Description |
---|
HalFormsConfiguration()
Creates a new
HalFormsConfiguration backed by a default HalConfiguration . |
HalFormsConfiguration(HalConfiguration halConfiguration)
Creates a new
HalFormsConfiguration for the given HalConfiguration . |
Modifier and Type | Method and Description |
---|---|
HalFormsConfiguration |
customize(com.fasterxml.jackson.databind.ObjectMapper mapper)
Customizes the given
ObjectMapper with the registered callback. |
HalConfiguration |
getHalConfiguration()
Returns the underlying
HalConfiguration . |
HalFormsConfiguration |
withMediaType(MediaType mediaType)
Registers additional media types that are supposed to be aliases to
MediaTypes.HAL_FORMS_JSON . |
HalFormsConfiguration |
withObjectMapperCustomizer(Consumer<com.fasterxml.jackson.databind.ObjectMapper> objectMapperCustomizer)
Register the given
Consumer to apply additional customizations on the ObjectMapper used to render
HAL documents. |
<T> HalFormsConfiguration |
withOptions(Class<T> type,
String property,
Function<AffordanceModel.PropertyMetadata,HalFormsOptions> creator)
Returns a new
HalFormsConfiguration with the given |
HalFormsConfiguration |
withPattern(Class<?> type,
String pattern)
Registers a regular expression pattern to be used for form descriptions of the given type.
|
public HalFormsConfiguration()
HalFormsConfiguration
backed by a default HalConfiguration
.public HalFormsConfiguration(HalConfiguration halConfiguration)
HalFormsConfiguration
for the given HalConfiguration
.halConfiguration
- must not be null.public HalFormsConfiguration withPattern(Class<?> type, String pattern)
type
- must not be null.pattern
- must not be null or empty.public HalFormsConfiguration withObjectMapperCustomizer(Consumer<com.fasterxml.jackson.databind.ObjectMapper> objectMapperCustomizer)
Consumer
to apply additional customizations on the ObjectMapper
used to render
HAL documents.objectMapperCustomizer
- must not be null.public HalFormsConfiguration withMediaType(MediaType mediaType)
MediaTypes.HAL_FORMS_JSON
. Registered
MediaType
s will be preferred over the default one, i.e. they'll be listed first in client's accept headers
etc.mediaType
- must not be null.public HalFormsConfiguration customize(com.fasterxml.jackson.databind.ObjectMapper mapper)
ObjectMapper
with the registered callback.mapper
- must not be null.withObjectMapperCustomizer(Consumer)
public <T> HalFormsConfiguration withOptions(Class<T> type, String property, Function<AffordanceModel.PropertyMetadata,HalFormsOptions> creator)
HalFormsConfiguration
with the givenT
- type
- theproperty
- creator
- public HalConfiguration getHalConfiguration()
HalConfiguration
.Copyright © 2011–2021 Pivotal, Inc.. All rights reserved.