public JsonParser.NumberType getNumberType() throws IOException, JsonParseException { Number localNumber = getNumberValue(); if ((localNumber instanceof Integer)) return JsonParser.NumberType.INT; if ((localNumber instanceof Long)) return JsonParser.NumberType.LONG; if ((localNumber instanceof Double)) return JsonParser.NumberType.DOUBLE; if ((localNumber instanceof BigDecimal)) return JsonParser.NumberType.BIG_DECIMAL; if ((localNumber instanceof Float)) return JsonParser.NumberType.FLOAT; if ((localNumber instanceof BigInteger)) return JsonParser.NumberType.BIG_INTEGER; return null; }
public JsonParser.NumberType getNumberType() throws IOException, JsonParseException { if (this._numTypesValid == 0) _parseNumericValue(0); if (this._currToken == JsonToken.VALUE_NUMBER_INT) { if ((0x1 & this._numTypesValid) != 0) return JsonParser.NumberType.INT; if ((0x2 & this._numTypesValid) != 0) return JsonParser.NumberType.LONG; return JsonParser.NumberType.BIG_INTEGER; } if ((0x10 & this._numTypesValid) != 0) return JsonParser.NumberType.BIG_DECIMAL; return JsonParser.NumberType.DOUBLE; }
public final JsonParser.NumberType getNumberType() { Number localNumber = getNumberValue(); if ((localNumber instanceof Integer)) return JsonParser.NumberType.INT; if ((localNumber instanceof Long)) return JsonParser.NumberType.LONG; if ((localNumber instanceof Double)) return JsonParser.NumberType.DOUBLE; if ((localNumber instanceof BigDecimal)) return JsonParser.NumberType.BIG_DECIMAL; if ((localNumber instanceof Float)) return JsonParser.NumberType.FLOAT; if ((localNumber instanceof BigInteger)) return JsonParser.NumberType.BIG_INTEGER; return null; }
public static Object decodeConstant(JsonNode valNode, String valType) { if (valType != null && valNode.isNumber()) { NumberType numType; Number numVal = valNode.getNumberValue(); if (valType != null) { numType = NumberType.valueOf(valType.toUpperCase()); switch (numType) { case DOUBLE: return numVal.doubleValue(); case FLOAT: return numVal.floatValue(); case INT: return numVal.intValue(); case LONG: return numVal.longValue(); default: break; } } } return asObject(valNode); }
public JsonParser.NumberType getNumberType() throws IOException, JsonParseException { JsonNode localJsonNode = currentNumericNode(); if (localJsonNode == null) return null; return localJsonNode.getNumberType(); }
private void setNumberField(JsonParser jp, PdxInstanceHelper pih, String fieldName) throws IOException { try{ NumberType nt = jp.getNumberType(); switch(nt) { case BIG_DECIMAL: pih.addBigDecimalField(fieldName, jp.getDecimalValue()); break; case BIG_INTEGER: { BigInteger bi = jp.getBigIntegerValue(); pih.addBigIntegerField(fieldName, bi); } break; case DOUBLE: pih.addDoubleField(fieldName, jp.getDoubleValue()); break; case FLOAT: pih.addFloatField(fieldName, jp.getFloatValue()); break; case INT: { int val = jp.getIntValue(); if (val > Short.MAX_VALUE || val < Short.MIN_VALUE) { pih.addIntField(fieldName, val); } else if (val > Byte.MAX_VALUE || val < Byte.MIN_VALUE) { pih.addShortField(fieldName, (short)val); } else { pih.addByteField(fieldName, (byte)val); } } break; case LONG: pih.addLongField(fieldName, jp.getLongValue()); break; default: throw new IllegalStateException("setNumberField:unknow number type " + nt); } }catch(JsonParseException jpe) { throw jpe; } catch (IOException e) { throw e; } }
private void setNumberField(JsonParser jp, PdxListHelper pih) throws IOException { try{ NumberType nt = jp.getNumberType(); switch(nt) { case BIG_DECIMAL: pih.addBigDecimalField(jp.getDecimalValue()); break; case BIG_INTEGER: { BigInteger bi = jp.getBigIntegerValue(); pih.addBigIntegerField(bi); } break; case DOUBLE: pih.addDoubleField(jp.getDoubleValue()); break; case FLOAT: pih.addFloatField(jp.getFloatValue()); break; case INT: { int val = jp.getIntValue(); if (val > Short.MAX_VALUE || val < Short.MIN_VALUE) { pih.addIntField(val); } else if (val > Byte.MAX_VALUE || val < Byte.MIN_VALUE) { pih.addShortField((short)val); } else { pih.addByteField((byte)val); } } break; case LONG: pih.addLongField(jp.getLongValue()); break; default: throw new IllegalStateException("setNumberField:unknow number type " + nt); } }catch(JsonParseException jpe) { throw jpe; } catch (IOException e) { throw e; } }
public JsonParser.NumberType getNumberType() throws IOException, JsonParseException { return this.delegate.getNumberType(); }
public JsonParser.NumberType getNumberType() { return JsonParser.NumberType.LONG; }
public JsonParser.NumberType getNumberType() { return JsonParser.NumberType.BIG_DECIMAL; }
public JsonParser.NumberType getNumberType() { return JsonParser.NumberType.BIG_INTEGER; }
public JsonParser.NumberType getNumberType() { return null; }
public JsonParser.NumberType getNumberType() { return JsonParser.NumberType.DOUBLE; }
public JsonParser.NumberType getNumberType() { return JsonParser.NumberType.INT; }
public JsonParser.NumberType getNumberType() { return this.delegate.getNumberType(); }
public abstract JsonParser.NumberType getNumberType();