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

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

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

JsonParser.builder介绍

暂无

代码示例

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

.pooled()
.parser(
  JsonParser.DEFAULT.builder()
    .ignoreUnknownBeanProperties(true)
    .pojoSwaps(JodaDateSwap.class)

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

@Test
public void testStreamsAutoClose() throws Exception {
  ReaderParser p = JsonParser.DEFAULT.builder().autoCloseStreams().build();
  Object x;
  Reader r;
  r = reader("{foo:'bar'}{baz:'qux'}");
  x = p.parse(r, ObjectMap.class);
  assertObjectEquals("{foo:'bar'}", x);
  try {
    x = p.parse(r, ObjectMap.class);
    fail("Exception expected");
  } catch (Exception e) {
    assertTrue(e.getMessage().contains("Reader is closed"));
  }
}

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

JsonParser p = JsonParser.DEFAULT;
if (name.contains("utf16LE"))
  p = p.builder().inputStreamCharset("UTF-16LE").build();
else if (name.contains("utf16BE"))
  p = p.builder().inputStreamCharset("UTF-16BE").build();

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

JsonParser p = JsonParser.DEFAULT_STRICT;
if (name.contains("utf16LE"))
  p = p.builder().inputStreamCharset("UTF-16LE").build();
else if (name.contains("utf16BE"))
  p = p.builder().inputStreamCharset("UTF-16BE").build();

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

private FullContact(FullContactConfiguration configuration) throws InstantiationException {
 this.configuration = configuration;
 this.parser = JsonParser.DEFAULT.builder()
  .ignoreUnknownBeanProperties(true)
  .build();
 this.serializer = JsonSerializer.DEFAULT.builder()
  .trimEmptyCollections(true)
  .trimEmptyMaps(true)
  .build();
 this.restClientBuilder = RestClient.create()
  .accept("application/json")
  .contentType("application/json")
  .disableAutomaticRetries()
  .disableCookieManagement()
  .disableRedirectHandling()
  .header("Authorization", "Bearer "+configuration.getToken())
  .parser(parser)
  .serializer(serializer)
  .rootUrl(baseUrl());
 this.restClient = restClientBuilder.build();
}

相关文章