Class SirenConfiguration


  • public class SirenConfiguration
    extends Object
    A Siren specific configuration that allows to configure specific parts of the library.
    Since:
    1.0.0
    Author:
    Ingo Griebsch
    • Constructor Detail

      • SirenConfiguration

        public SirenConfiguration()
    • Method Detail

      • withEntityAndCollectionModelSubclassingEnabled

        public SirenConfiguration withEntityAndCollectionModelSubclassingEnabled​(boolean enabled)
        Configures whether it is possible to subclass EntityModels and CollectionModels. Defaults to false.
        Parameters:
        enabled - whether subclassing of EntityModels and CollectionModels should be enabled or not.
        Returns:
        the updated configuration reflecting the setting
      • withActionFieldTypeMappging

        @Deprecated
        public SirenConfiguration withActionFieldTypeMappging​(@NonNull
                                                              @NonNull Class<?> source,
                                                              @NonNull
                                                              @NonNull SirenActionFieldType target)
        Configures additional mappings that are used to convert the type of a payload field into a Siren action field type.

        These mappings override the default mappings that are defined inside the library. The order of the defined mappings is important because the class hierarchy is taken into consideration.

        Parameters:
        source - the type of the member that is part of the payload that is transformed into Siren action fields.
        target - the type of the Siren Action field that should represent the source type in the Siren representation.
        Returns:
        the updated configuration reflecting the setting
      • withActionFieldTypeMappging

        public SirenConfiguration withActionFieldTypeMappging​(@NonNull
                                                              @NonNull Class<?> source,
                                                              @NonNull
                                                              @NonNull org.springframework.hateoas.mediatype.html.HtmlInputType target)
        Configures additional mappings that are used to convert the type of a payload field into a Siren action field type.

        These mappings override the default mappings that are defined inside the library. The order of the defined mappings is important because the class hierarchy is taken into consideration.

        Parameters:
        source - the type of the member that is part of the payload that is transformed into Siren action fields.
        target - the type of the Siren Action field that should represent the source type in the Siren representation.
        Returns:
        the updated configuration reflecting the setting
      • withObjectMapperCustomizer

        public SirenConfiguration withObjectMapperCustomizer​(@NonNull
                                                             @NonNull Consumer<com.fasterxml.jackson.databind.ObjectMapper> objectMapperCustomizer)
        Configures the ObjectMapper instance that is used for serialization.
        Parameters:
        objectMapperCustomizer - the customizer which is used to apply additional customizations to the ObjectMapper instance that is used for serialization.
        Returns:
        the updated configuration reflecting the setting