本文整理了Java中org.codehaus.jackson.JsonNode.isIntegralNumber()
方法的一些代码示例,展示了JsonNode.isIntegralNumber()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonNode.isIntegralNumber()
方法的具体详情如下:
包路径:org.codehaus.jackson.JsonNode
类名称:JsonNode
方法名:isIntegralNumber
暂无
代码示例来源:origin: kaaproject/kaa
if (byDefault.isIntegralNumber() && AvroUtils.getSchemaByType(schemaNode, Type.INT) != null) {
return byDefault.asInt();
if (byDefault.isIntegralNumber() && AvroUtils.getSchemaByType(schemaNode, Type.LONG) != null) {
return byDefault.asLong();
代码示例来源:origin: com.atlassian.jira/jira-core
public boolean isIntegralNumber()
{
return delegate.isIntegralNumber();
}
代码示例来源:origin: oVirt/ovirt-engine
boolean checkOptionalIntegerNode(JsonNode root, String fieldName) {
JsonNode target = root.path(fieldName);
return !target.isMissingNode() ? target.isIntegralNumber() : true;
}
代码示例来源:origin: org.apache.isis.viewer/isis-viewer-restfulobjects-applib
private boolean isIntegralNumber(final JsonNode node) {
return !representsNull(node) && node.isValueNode() && node.isIntegralNumber();
}
代码示例来源:origin: NGDATA/lilyproject
protected Long readLong(ValueHandle handle, ReadContext context)
throws JsonFormatException, RepositoryException, InterruptedException {
if (handle.node.isIntegralNumber()) {
return handle.node.getLongValue();
} else if (handle.node.isTextual()) {
try {
return Long.parseLong(handle.node.getTextValue());
} catch (NumberFormatException e) {
throw new JsonFormatException(String.format("Unparsable long value in property '%s': %s", handle.prop,
handle.node.getTextValue()));
}
} else {
throw new JsonFormatException("Expected long value for property '" + handle.prop + "'");
}
}
代码示例来源:origin: eBay/YiDB
@Override
public Object read(IEntity curEntity, Object valueNode, MetaField metaField) {
CheckConditions.checkNotNull(metaField);
CheckConditions.checkNotNull(valueNode);
JsonNode jsonNode = (JsonNode)valueNode;
if (jsonNode.isNull()) {
return null;
}
CheckConditions.checkArgument(jsonNode.isIntegralNumber(), "Field '%s' should be date. But the value is %s",
metaField.getName(), jsonNode);
long time = jsonNode.getLongValue();
Date date = new Date();
date.setTime(time);
return date;
}
代码示例来源:origin: NGDATA/lilyproject
protected Integer readInteger(ValueHandle handle, ReadContext context)
throws JsonFormatException, RepositoryException, InterruptedException {
if (handle.node.isIntegralNumber()) {
return handle.node.getIntValue();
} else if (handle.node.isTextual()) {
try {
return Integer.parseInt(handle.node.getTextValue());
} catch (NumberFormatException e) {
throw new JsonFormatException(String.format("Unparsable int value in property '%s': %s", handle.prop,
handle.node.getTextValue()));
}
} else {
throw new JsonFormatException("Expected int value for property '" + handle.prop + "'");
}
}
代码示例来源:origin: com.googlecode.etl-unit/json-validator
private Double readBigDecimal(ObjectNode node, String property, Double default_) throws JsonSchemaValidationException {
JsonNode reqNode = node.get(property);
if (reqNode == null)
{
return default_;
}
// check that this object is defining a number type
if (!reqNode.isNumber() && !reqNode.isIntegralNumber())
{
throw new JsonSchemaValidationException("Cannot specify property " + property + " on a non-number type", "", reqNode, null);
}
if (!reqNode.isNumber())
{
throw new JsonSchemaValidationException(property + " property must be an integer", "", reqNode, null);
}
return new Double(reqNode.asDouble());
}
代码示例来源:origin: com.googlecode.etl-unit/json-validator
if (node.isInt() || node.isIntegralNumber() || node.isLong() || node.isBigInteger())
内容来源于网络,如有侵权,请联系作者删除!