Class MetadataConfiguration
java.lang.Object
org.springframework.data.rest.core.config.MetadataConfiguration
Configuration for metadata exposure.
- Author:
- Oliver Gierke
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether the ALPS resources are exposed.getPatternFor
(Class<?> type) Returns thePattern
registered for the given value type.getSchemaFormatFor
(Class<?> type) Returns theJsonSchemaFormat
to be used for the given type.boolean
Returns whether to omit documentation attributes for unresolvable resource bundle keys.void
registerFormattingPatternFor
(String pattern, Class<?> type) Registers the given formatting patter for the given value type.void
registerJsonSchemaFormat
(JsonSchemaFormat format, Class<?>... types) void
setAlpsEnabled
(boolean enableAlps) Configures whether to expose the ALPS resources.void
setOmitUnresolvableDescriptionKeys
(boolean omitUnresolvableDescriptionKeys) Configures whether to omit documentation attributes for unresolvable resource bundle keys.
-
Constructor Details
-
MetadataConfiguration
public MetadataConfiguration()
-
-
Method Details
-
setOmitUnresolvableDescriptionKeys
public void setOmitUnresolvableDescriptionKeys(boolean omitUnresolvableDescriptionKeys) Configures whether to omit documentation attributes for unresolvable resource bundle keys. Defaults to true, which means that an unsuccessful attempt to resolve the message will cause no documentation entry to be rendered for the metadata resources.- Parameters:
omitUnresolvableDescriptionKeys
- whether to omit documentation attributes for unresolvable resource bundle keys.
-
omitUnresolvableDescriptionKeys
public boolean omitUnresolvableDescriptionKeys()Returns whether to omit documentation attributes for unresolvable resource bundle keys.- Returns:
- the omitUnresolvableDescriptionKeys
-
setAlpsEnabled
public void setAlpsEnabled(boolean enableAlps) Configures whether to expose the ALPS resources.- Parameters:
enableAlps
- whether to expose ALPS resources.
-
alpsEnabled
public boolean alpsEnabled()Returns whether the ALPS resources are exposed.- Returns:
- the alpsEnabled
-
registerJsonSchemaFormat
-
getSchemaFormatFor
Returns theJsonSchemaFormat
to be used for the given type.- Parameters:
type
- must not be null.- Returns:
-
registerFormattingPatternFor
Registers the given formatting patter for the given value type.- Parameters:
pattern
- must not be null or empty.type
- must not be null.
-
getPatternFor
Returns thePattern
registered for the given value type.- Parameters:
type
- must not be null.- Returns:
-