org.elasticsearch.common.xcontent.XContentParserUtils.throwUnknownToken()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(103)

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

XContentParserUtils.throwUnknownToken介绍

暂无

代码示例

代码示例来源:origin: org.elasticsearch/elasticsearch

throwUnknownToken(token, parser.getTokenLocation());

代码示例来源:origin: org.elasticsearch/elasticsearch

throws IOException {
if (parser.currentToken() != Token.START_OBJECT && parser.currentToken() != Token.START_ARRAY) {
  throwUnknownToken(parser.currentToken(), parser.getTokenLocation());

代码示例来源:origin: org.elasticsearch/elasticsearch

builder.put(key, parser.booleanValue());
} else {
  XContentParserUtils.throwUnknownToken(parser.currentToken(), parser.getTokenLocation());

代码示例来源:origin: org.elasticsearch/elasticsearch

value = parser.listOrderedMap();
} else {
  throwUnknownToken(token, parser.getTokenLocation());

代码示例来源:origin: org.elasticsearch/elasticsearch

XContentParserUtils.throwUnknownToken(token, parser.getTokenLocation());

代码示例来源:origin: org.elasticsearch/elasticsearch

XContentParserUtils.throwUnknownToken(token, parser.getTokenLocation());

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

throwUnknownToken(token, parser.getTokenLocation());

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

throwUnknownToken(token, parser.getTokenLocation());

代码示例来源:origin: apache/servicemix-bundles

throwUnknownToken(token, parser.getTokenLocation());

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

throws IOException {
if (parser.currentToken() != Token.START_OBJECT && parser.currentToken() != Token.START_ARRAY) {
  throwUnknownToken(parser.currentToken(), parser.getTokenLocation());

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

throwUnknownToken(token, parser.getTokenLocation());

代码示例来源:origin: apache/servicemix-bundles

throws IOException {
if (parser.currentToken() != Token.START_OBJECT && parser.currentToken() != Token.START_ARRAY) {
  throwUnknownToken(parser.currentToken(), parser.getTokenLocation());

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

builder.put(key, parser.booleanValue());
} else {
  XContentParserUtils.throwUnknownToken(parser.currentToken(), parser.getTokenLocation());

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

throwUnknownToken(token, parser.getTokenLocation());

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

/**
 * Parse the current token depending on its token type. The following token types will be
 * parsed by the corresponding parser methods:
 * <ul>
 *    <li>XContentParser.Token.VALUE_STRING: parser.text()</li>
 *    <li>XContentParser.Token.VALUE_NUMBER: parser.numberValue()</li>
 *    <li>XContentParser.Token.VALUE_BOOLEAN: parser.booleanValue()</li>
 *    <li>XContentParser.Token.VALUE_EMBEDDED_OBJECT: parser.binaryValue()</li>
 * </ul>
 *
 * @throws ParsingException if the token none of the allowed values
 */
public static Object parseStoredFieldsValue(XContentParser parser) throws IOException {
  XContentParser.Token token = parser.currentToken();
  Object value = null;
  if (token == XContentParser.Token.VALUE_STRING) {
    //binary values will be parsed back and returned as base64 strings when reading from json and yaml
    value = parser.text();
  } else if (token == XContentParser.Token.VALUE_NUMBER) {
    value = parser.numberValue();
  } else if (token == XContentParser.Token.VALUE_BOOLEAN) {
    value = parser.booleanValue();
  } else if (token == XContentParser.Token.VALUE_EMBEDDED_OBJECT) {
    //binary values will be parsed back and returned as BytesArray when reading from cbor and smile
    value = new BytesArray(parser.binaryValue());
  } else {
    throwUnknownToken(token, parser.getTokenLocation());
  }
  return value;
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

throwUnknownToken(token, parser.getTokenLocation());

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

value = parser.listOrderedMap();
} else {
  throwUnknownToken(token, parser.getTokenLocation());

代码示例来源:origin: apache/servicemix-bundles

value = parser.listOrderedMap();
} else {
  throwUnknownToken(token, parser.getTokenLocation());

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

throwUnknownToken(token, parser.getTokenLocation());

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

XContentParserUtils.throwUnknownToken(token, parser.getTokenLocation());

相关文章