Class JacksonConfig

java.lang.Object
org.vrspace.server.config.JacksonConfig

@Configuration public class JacksonConfig extends Object
Jackson JSON parser configuration. Configures date format and string de/serializers to prevent XSS.
Author:
joe
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    Converts JSON string to Java string
    class 
    Converts Java string to JSON string
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.fasterxml.jackson.databind.ObjectMapper
    ObjectMapper for serialization over web sockets.
    org.springframework.http.converter.json.Jackson2ObjectMapperBuilder
     
    com.fasterxml.jackson.databind.ObjectMapper
    Private mapper is same as objectMapper, but also serializes @Private fields, so that a client can access own private properties over web sockets.
    com.fasterxml.jackson.databind.ObjectMapper
    Primary mapper is the same as objectMapper, but ignores @JsonTypeInfo annotation of VRObject.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JacksonConfig

      public JacksonConfig()
  • Method Details

    • objectMapper

      @Bean("objectMapper") public com.fasterxml.jackson.databind.ObjectMapper objectMapper()
      ObjectMapper for serialization over web sockets. By default, fields that are annotated as @Private will not be serialized.
    • privateMapper

      @Bean("privateMapper") public com.fasterxml.jackson.databind.ObjectMapper privateMapper()
      Private mapper is same as objectMapper, but also serializes @Private fields, so that a client can access own private properties over web sockets.
    • restMapper

      @Primary @Bean("restMapper") public com.fasterxml.jackson.databind.ObjectMapper restMapper()
      Primary mapper is the same as objectMapper, but ignores @JsonTypeInfo annotation of VRObject. Annotated as Primary to make REST controllers used it for serialization.
    • objectMapperBuilder

      @Bean public org.springframework.http.converter.json.Jackson2ObjectMapperBuilder objectMapperBuilder()