Examples of JSONPObject


Examples of com.fasterxml.jackson.databind.util.JSONPObject

            partyEntityDto.setName(partyEntity.getName());

            partyEntityDtos.add(partyEntityDto);
        }

        return new JSONPObject(callback, partyEntityDtos);
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.util.JSONPObject

    if (callback == null || callback.isEmpty())
      throw new IllegalArgumentException("Missing callback name");
    if (object == null)
      throw new IllegalArgumentException("Object was null");
    try {
      return jsonMapper.writeValueAsString(new JSONPObject(callback, object));
    } catch (JsonProcessingException e) {
      throw new JSONException(e);
    }
  }
View Full Code Here

Examples of com.fasterxml.jackson.databind.util.JSONPObject

    if (callback == null || callback.isEmpty())
      throw new IllegalArgumentException("Missing callback name");
    if (object == null)
      throw new IllegalArgumentException("Object was null");
    try {
      return jsonMapper.writeValueAsBytes(new JSONPObject(callback, object));
    } catch (JsonProcessingException e) {
      throw new JSONException(e);
    }
  }
View Full Code Here

Examples of com.fasterxml.jackson.databind.util.JSONPObject

        return (T) mapper.readValue(jsonString, typeReference);
    }

    public String toJsonP(String functionName, Object object)
            throws IOException {
        return toJson(new JSONPObject(functionName, object));
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.util.JSONPObject

    @Override
    public void invoke(Context context, Result result) {
        ResponseStreams responseStreams = context.finalizeHeaders(result);
        String callback = getCallbackName(context);
        try (OutputStream outputStream = responseStreams.getOutputStream()) {
            objectMapper.writeValue(outputStream, new JSONPObject(callback, result.getRenderable()));
        } catch (IOException e) {
            logger.error("Error while rendering jsonp.", e);
        }
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.util.JSONPObject

            // full prefix+suffix?
            if (_jsonp.prefix != null || _jsonp.suffix != null) {
                return new JSONWrappedObject(_jsonp.prefix, _jsonp.suffix, value);
            }
            if (_jsonp.method != null) {
                return new JSONPObject(_jsonp.method, value);
            }
        }
        return value;
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.util.JSONPObject

  /**
   * 輸出JSONP格式數據.
   */
  public String toJsonP(String functionName, Object object) {
    return toJson(new JSONPObject(functionName, object));
  }
View Full Code Here

Examples of com.fasterxml.jackson.databind.util.JSONPObject

    // 设置需要被格式化为JSON字符串的内容.
    Map<String, String> map = Collections.singletonMap("content", "<p>你好,世界!</p>");

    // 渲染返回结果.
    return new JSONPObject(callbackName, map);
  }
View Full Code Here

Examples of com.fasterxml.jackson.databind.util.JSONPObject

            }
        }

        String jsonpFunctionName = getJsonpFunctionName();
        if (jsonpFunctionName != null) {
            value = new JSONPObject(jsonpFunctionName, value, rootType);
            rootType = null;
        }

        ObjectWriter writer;
        if (rootType != null) {
View Full Code Here

Examples of com.fasterxml.jackson.databind.util.JSONPObject

            // full prefix+suffix?
            if (_jsonp.prefix != null || _jsonp.suffix != null) {
                return new JSONWrappedObject(_jsonp.prefix, _jsonp.suffix, value);
            }
            if (_jsonp.method != null) {
                return new JSONPObject(_jsonp.method, value);
            }
        }
        return value;
    }
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.