本文整理了Java中com.google.api.client.json.JsonParser.getText()
方法的一些代码示例,展示了JsonParser.getText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonParser.getText()
方法的具体详情如下:
包路径:com.google.api.client.json.JsonParser
类名称: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);
内容来源于网络,如有侵权,请联系作者删除!