Package org.vrspace.server.config
Class JacksonConfig
java.lang.Object
org.vrspace.server.config.JacksonConfig
Jackson JSON parser configuration. Configures date format and string
de/serializers to prevent XSS.
- Author:
- joe
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Converts JSON string to Java stringclass
Converts Java string to JSON string -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.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.
-
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()
-