com.google.api.client.json.JsonParser.getText()方法的使用及代码示例

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

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

JsonParser.getText介绍

暂无

代码示例

代码示例来源:origin: com.google.api.client/google-api-client-googleapis

@Override
Object parseItemInternal() throws IOException {
 parser.nextToken();
 String key = parser.getText();
 if (key != "kind") {
  throw new IllegalArgumentException("expected kind field: " + key);
 }
 parser.nextToken();
 String kind = parser.getText();
 Class<?> itemClass = kindToItemClassMap.get(kind);
 if (itemClass == null) {
  throw new IllegalArgumentException("unrecognized kind: " + kind);
 }
 return parser.parse(itemClass, null);
}

代码示例来源:origin: com.google.http-client/google-http-client-test

public void testSkipToKey_found() throws Exception {
 JsonParser parser = newFactory().createJsonParser(JSON_ENTRY);
 parser.nextToken();
 parser.skipToKey("title");
 assertEquals(JsonToken.VALUE_STRING, parser.getCurrentToken());
 assertEquals("foo", parser.getText());
}

代码示例来源:origin: com.google.api-client/google-api-client

while (parser.nextToken() != JsonToken.END_OBJECT) {
 parser.nextToken();
 String certValue = parser.getText();
 X509Certificate x509Cert = (X509Certificate) factory.generateCertificate(
   new ByteArrayInputStream(StringUtils.getBytesUtf8(certValue)));

代码示例来源:origin: com.google.http-client/google-http-client-test

public void testSkipChildren_string() throws Exception {
 JsonParser parser = newFactory().createJsonParser(JSON_ENTRY);
 parser.nextToken();
 parser.skipToKey("title");
 parser.skipChildren();
 assertEquals(JsonToken.VALUE_STRING, parser.getCurrentToken());
 assertEquals("foo", parser.getText());
}

代码示例来源:origin: com.google.http-client/google-http-client-test

public void testSkipToKey_startWithFieldName() throws Exception {
 JsonParser parser = newFactory().createJsonParser(JSON_ENTRY);
 parser.nextToken();
 parser.nextToken();
 parser.skipToKey("title");
 assertEquals(JsonToken.VALUE_STRING, parser.getCurrentToken());
 assertEquals("foo", parser.getText());
}

代码示例来源:origin: com.google.api-client/google-api-client

detailString = parser.getText();
} else if (parser.getCurrentToken() == JsonToken.START_OBJECT) {
 details = parser.parseAndClose(GoogleJsonError.class);

相关文章