Examples of WebSocketDataGSONAdapter


Examples of org.structr.websocket.WebSocketDataGSONAdapter

  public void configure(final WebSocketServletFactory factory) {
   
    // create GSON serializer
    final GsonBuilder gsonBuilder = new GsonBuilder()
      .setPrettyPrinting()
      .registerTypeAdapter(WebSocketMessage.class, new WebSocketDataGSONAdapter(config.getDefaultIdProperty(), config.getOutputNestingDepth()));
   
    final boolean lenient = Boolean.parseBoolean(StructrApp.getConfigurationValue("json.lenient", "false"));
    if (lenient) {
      // Serializes NaN, -Infinity, Infinity, see http://code.google.com/p/google-gson/issues/detail?id=378
      gsonBuilder.serializeSpecialFloatingPointValues();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.