本文整理了Java中org.codehaus.jackson.JsonNode.getNumberType()
方法的一些代码示例,展示了JsonNode.getNumberType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonNode.getNumberType()
方法的具体详情如下:
包路径:org.codehaus.jackson.JsonNode
类名称:JsonNode
方法名:getNumberType
[英]If this node is a numeric type (as per #isNumber), returns native type that node uses to store the numeric value.
[中]如果此节点是数值类型(根据#isNumber),则返回节点用于存储数值的本机类型。
代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl
@Override
public NumberType getNumberType() throws IOException, JsonParseException {
JsonNode n = currentNumericNode();
return (n == null) ? null : n.getNumberType();
}
代码示例来源:origin: azkaban/azkaban
return node.asDouble();
} else {
System.err.println("ERROR What is this!? " + node.getNumberType());
return null;
代码示例来源:origin: camunda/camunda-bpm-platform
@Override
public NumberType getNumberType() throws IOException, JsonParseException {
JsonNode n = currentNumericNode();
return (n == null) ? null : n.getNumberType();
}
代码示例来源:origin: com.atlassian.jira/jira-core
public JsonParser.NumberType getNumberType()
{
return delegate.getNumberType();
}
代码示例来源:origin: com.barchart.wrap/barchart-wrap-jackson
@Override
public NumberType getNumberType() throws IOException, JsonParseException {
JsonNode n = currentNumericNode();
return (n == null) ? null : n.getNumberType();
}
代码示例来源:origin: org.codehaus.jackson/jackson-mapper-lgpl
@Override
public NumberType getNumberType() throws IOException, JsonParseException {
JsonNode n = currentNumericNode();
return (n == null) ? null : n.getNumberType();
}
代码示例来源:origin: ovea-deprecated/jetty-session-redis
@Override
public NumberType getNumberType() throws IOException, JsonParseException {
JsonNode n = currentNumericNode();
return (n == null) ? null : n.getNumberType();
}
代码示例来源:origin: com.linkedin.azkaban/az-core
return node.asDouble();
} else {
System.err.println("ERROR What is this!? " + node.getNumberType());
return null;
代码示例来源:origin: com.linkedin.azkaban/azkaban
} else {
System.err.println("ERROR What is this!? "
+ node.getNumberType());
return null;
代码示例来源:origin: sirensolutions/siren
switch (jsonNode.getNumberType()) {
case LONG :
if (termOrRangeQuery.getMin() != null
代码示例来源:origin: FasterXML/jackson-dataformats-binary
return new ScalarDefaults.NullDefaults(name);
case VALUE_NUMBER_FLOAT:
switch (defaultAsNode.getNumberType()) {
case FLOAT:
return new ScalarDefaults.FloatDefaults(name, (float) defaultAsNode.asDouble());
switch (defaultAsNode.getNumberType()) {
case INT:
return new ScalarDefaults.FloatDefaults(name, defaultAsNode.asInt());
代码示例来源:origin: lordofthejars/nosql-unit
private Object simpleValue(JsonNode simpleValue) {
if (simpleValue.isNumber()) {
switch (simpleValue.getNumberType()) {
case BIG_DECIMAL:
return simpleValue.getDecimalValue();
case BIG_INTEGER:
return simpleValue.getBigIntegerValue();
case DOUBLE:
return simpleValue.getDoubleValue();
case FLOAT:
return simpleValue.getDoubleValue();
case INT:
return simpleValue.getIntValue();
case LONG:
return simpleValue.getLongValue();
default:
return simpleValue.getTextValue();
}
} else {
return simpleValue.getTextValue();
}
}
代码示例来源:origin: com.lordofthejars/nosqlunit-core
private Object simpleValue(JsonNode simpleValue) {
if (simpleValue.isNumber()) {
switch (simpleValue.getNumberType()) {
case BIG_DECIMAL:
return simpleValue.getDecimalValue();
case BIG_INTEGER:
return simpleValue.getBigIntegerValue();
case DOUBLE:
return simpleValue.getDoubleValue();
case FLOAT:
return simpleValue.getDoubleValue();
case INT:
return simpleValue.getIntValue();
case LONG:
return simpleValue.getLongValue();
default:
return simpleValue.getTextValue();
}
} else {
return simpleValue.getTextValue();
}
}
内容来源于网络,如有侵权,请联系作者删除!