javax.json.stream.JsonParser.getLong()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(148)

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

JsonParser.getLong介绍

[英]Returns a JSON number as a long. The returned value is equal to new BigDecimal(getString()).longValue(). Note that this conversion can lose information about the overall magnitude and precision of the number value as well as return a result with the opposite sign. This method is only called when the parser state is Event#VALUE_NUMBER.
[中]以长字符串形式返回JSON编号。返回的值等于新的BigDecimal(getString())。longValue()。请注意,此转换可能会丢失有关数值的总体大小和精度的信息,并返回带有相反符号的结果。仅当解析器状态为Event#VALUE _NUMBER时才调用此方法。

代码示例

代码示例来源:origin: org.apache.johnzon/johnzon-core

@Override
public long getLong() {
  return jsonParser.getLong();
}

代码示例来源:origin: org.eclipse/yasson

@Override
public long getLong() {
  return jsonParser.getLong();
}

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

@Override
public long getLong() {
  return jsonParser.getLong();
}

代码示例来源:origin: com.owlike/genson

break;
case VALUE_NUMBER:
 if (parser.isIntegralNumber()) objectBuilder.add(name, parser.getLong());
 else objectBuilder.add(name, parser.getBigDecimal());
 break;

代码示例来源:origin: owlike/genson

break;
case VALUE_NUMBER:
 if (parser.isIntegralNumber()) objectBuilder.add(name, parser.getLong());
 else objectBuilder.add(name, parser.getBigDecimal());
 break;

代码示例来源:origin: beckchr/staxon

@Override
public Value value() throws IOException {
  switch (consume(JsonStreamToken.VALUE)) {
  case VALUE_STRING:
    return new Value(parser.getString());
  case VALUE_TRUE:
    return TRUE;
  case VALUE_FALSE:
    return FALSE;
  case VALUE_NUMBER:
    if (parser.isIntegralNumber()) {
      return new Value(parser.getString(), Long.valueOf(parser.getLong()));
    } else {
      return new Value(parser.getString(), parser.getBigDecimal());
    }
  case VALUE_NULL:
    return NULL;
  default:
    throw new IllegalStateException("Unexpected event");
  }
}

代码示例来源:origin: org.opendaylight.aaa/aaa-authn-idpmapping

return parser.getLong();
} else {
  return parser.getBigDecimal().doubleValue();

代码示例来源:origin: apache/activemq-artemis

builder.add(key, new JsonLongImpl(parser.getLong()));
} else {
  builder.add(key, new JsonNumberImpl(parser.getBigDecimal()));

代码示例来源:origin: apache/activemq-artemis

builder.add(key, new JsonLongImpl(parser.getLong()));
} else {
  builder.add(key, new JsonNumberImpl(parser.getBigDecimal()));

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

builder.add(key, new JsonLongImpl(parser.getLong()));
} else {
  builder.add(key, new JsonNumberImpl(parser.getBigDecimal()));

代码示例来源:origin: radcortez/wow-auctions

protected boolean readAuctionItem(Auction auction) {
  if (parser.getString().equalsIgnoreCase("auc")) {
    parser.next();
    auction.setAuctionId(parser.getLong());
    parser.next();
    parser.next();
    auction.setItemId(parser.getInt());
    parser.next();
    parser.next();
    parser.next();
    parser.next();
    auction.setOwnerRealm(parser.getString());
    parser.next();
    parser.next();
    auction.setBid(parser.getLong());
    parser.next();
    parser.next();
    auction.setBuyout(parser.getLong());
    parser.next();
    parser.next();
    auction.setQuantity(parser.getInt());
    return true;
  }
  return false;
}

代码示例来源:origin: dsukhoroslov/bagri

case VALUE_NUMBER:
  if (parser.isIntegralNumber()) {
    ctx.addValue(parser.getLong());
  } else {
    ctx.addValue(parser.getBigDecimal());

代码示例来源:origin: owlike/genson

break;
case VALUE_NUMBER:
 if (parser.isIntegralNumber()) arrayBuilder.add(parser.getLong());
 else arrayBuilder.add(parser.getBigDecimal());
 break;

代码示例来源:origin: com.owlike/genson

break;
case VALUE_NUMBER:
 if (parser.isIntegralNumber()) arrayBuilder.add(parser.getLong());
 else arrayBuilder.add(parser.getBigDecimal());
 break;

代码示例来源:origin: apache/activemq-artemis

builder.add(new JsonLongImpl(parser.getLong()));
} else {
  builder.add(new JsonNumberImpl(parser.getBigDecimal()));

代码示例来源:origin: apache/activemq-artemis

builder.add(new JsonLongImpl(parser.getLong()));
} else {
  builder.add(new JsonNumberImpl(parser.getBigDecimal()));

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

builder.add(new JsonLongImpl(parser.getLong()));
} else {
  builder.add(new JsonNumberImpl(parser.getBigDecimal()));

相关文章