org.apache.juneau.json.JsonSerializer.toStringObject()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(162)

本文整理了Java中org.apache.juneau.json.JsonSerializer.toStringObject()方法的一些代码示例,展示了JsonSerializer.toStringObject()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonSerializer.toStringObject()方法的具体详情如下:
包路径:org.apache.juneau.json.JsonSerializer
类名称:JsonSerializer
方法名:toStringObject

JsonSerializer.toStringObject介绍

暂无

代码示例

代码示例来源:origin: apache/juneau

/**
 * Same as {@link #log(Level, String, Object...)} excepts runs the arguments through {@link JsonSerializer#DEFAULT_READABLE}.
 *
 * <p>
 * Serialization of arguments do not occur if message is not logged, so it's safe to use this method from within
 * debug log statements.
 *
 * <h5 class='section'>Example:</h5>
 * <p class='bcode w800'>
 *     logObjects(<jsf>DEBUG</jsf>, <js>"Pojo contents:\n{0}"</js>, myPojo);
 * </p>
 *
 * @param level The log level.
 * @param msg The message to log.
 * @param args Optional {@link MessageFormat}-style arguments.
 */
@Override /* RestLogger */
public void logObjects(Level level, String msg, Object...args) {
  for (int i = 0; i < args.length; i++)
    args[i] = SimpleJsonSerializer.DEFAULT_READABLE.toStringObject(args[i]);
  log(level, null, msg, args);
}

代码示例来源:origin: org.apache.juneau/juneau-server

/**
 * Same as {@link #log(Level, String, Object...)} excepts runs the
 *  arguments through {@link JsonSerializer#DEFAULT_LAX_READABLE}.
 * <p>
 *     Serialization of arguments do not occur if message is not logged, so
 *         it's safe to use this method from within debug log statements.
 *    </p>
 *
 * <h6 class='topic'>Example:</h6>
 * <p class='bcode'>
 *     logObjects(<jsf>DEBUG</jsf>, <js>"Pojo contents:\n{0}"</js>, myPojo);
 * </p>
 *
 * @param level The log level.
 * @param msg The message to log.
 * @param args {@link MessageFormat} style arguments in the message.
 */
protected void logObjects(Level level, String msg, Object...args) {
  for (int i = 0; i < args.length; i++)
    args[i] = JsonSerializer.DEFAULT_LAX_READABLE.toStringObject(args[i]);
  log(level, null, msg, args);
}

代码示例来源:origin: org.apache.juneau/juneau-rest-server

/**
 * Same as {@link #log(Level, String, Object...)} excepts runs the arguments through {@link JsonSerializer#DEFAULT_READABLE}.
 *
 * <p>
 * Serialization of arguments do not occur if message is not logged, so it's safe to use this method from within
 * debug log statements.
 *
 * <h5 class='section'>Example:</h5>
 * <p class='bcode w800'>
 *     logObjects(<jsf>DEBUG</jsf>, <js>"Pojo contents:\n{0}"</js>, myPojo);
 * </p>
 *
 * @param level The log level.
 * @param msg The message to log.
 * @param args Optional {@link MessageFormat}-style arguments.
 */
@Override /* RestLogger */
public void logObjects(Level level, String msg, Object...args) {
  for (int i = 0; i < args.length; i++)
    args[i] = SimpleJsonSerializer.DEFAULT_READABLE.toStringObject(args[i]);
  log(level, null, msg, args);
}

代码示例来源:origin: apache/juneau

/**
 * Same as {@link #log(Level, String, Object...)} excepts runs the arguments through {@link JsonSerializer#DEFAULT_READABLE}.
 *
 * <p>
 * Serialization of arguments do not occur if message is not logged, so it's safe to use this method from within
 * debug log statements.
 *
 * <h5 class='section'>Example:</h5>
 * <p class='bcode w800'>
 *     logObjects(<jsf>DEBUG</jsf>, <js>"Pojo contents:\n{0}"</js>, myPojo);
 * </p>
 *
 * @param level The log level.
 * @param msg The message to log.
 * @param args Optional {@link MessageFormat}-style arguments.
 */
@Override /* RestLogger */
public void logObjects(Level level, String msg, Object...args) {
  for (int i = 0; i < args.length; i++)
    args[i] = SimpleJsonSerializer.DEFAULT_READABLE.toStringObject(args[i]);
  log(level, null, msg, args);
}

相关文章