private void _testInts(JsonFactory f, int[] values, byte[] data, int offset, int readSize) throws IOException { AsyncReaderWrapper r = asyncForBytes(f, readSize, data, offset); // start with "no token" assertNull(r.currentToken()); assertToken(JsonToken.START_ARRAY, r.nextToken()); for (int i = 0; i < values.length; ++i) { assertToken(JsonToken.VALUE_NUMBER_INT, r.nextToken()); assertEquals(values[i], r.getIntValue()); assertEquals(NumberType.INT, r.getNumberType()); // and then couple of special modes, just to get better test coverage String asStr = String.valueOf(values[i]); assertEquals(asStr, r.currentText()); StringWriter sw = new StringWriter(); assertEquals(asStr.length(), r.parser().getText(sw)); assertEquals(asStr, sw.toString()); } assertToken(JsonToken.END_ARRAY, r.nextToken()); // and end up with "no token" as well assertNull(r.nextToken()); assertTrue(r.isClosed()); }
private void _testLong(JsonFactory f, long[] values, byte[] data, int offset, int readSize) throws IOException { AsyncReaderWrapper r = asyncForBytes(f, readSize, data, offset); // start with "no token" assertNull(r.currentToken()); assertToken(JsonToken.START_ARRAY, r.nextToken()); for (int i = 0; i < values.length; ++i) { assertToken(JsonToken.VALUE_NUMBER_INT, r.nextToken()); assertEquals(values[i], r.getLongValue()); assertEquals(NumberType.LONG, r.getNumberType()); } assertToken(JsonToken.END_ARRAY, r.nextToken()); // and end up with "no token" as well assertNull(r.nextToken()); assertTrue(r.isClosed()); }
private void _testFloats(JsonFactory f, float[] values, byte[] data, int offset, int readSize) throws IOException { AsyncReaderWrapper r = asyncForBytes(f, readSize, data, offset); // start with "no token" assertNull(r.currentToken()); assertToken(JsonToken.START_ARRAY, r.nextToken()); for (int i = 0; i < values.length; ++i) { assertToken(JsonToken.VALUE_NUMBER_FLOAT, r.nextToken()); assertEquals(values[i], r.getFloatValue()); // json can't distinguish floats from doubles so assertEquals(NumberType.DOUBLE, r.getNumberType()); } assertToken(JsonToken.END_ARRAY, r.nextToken()); // and end up with "no token" as well assertNull(r.nextToken()); assertTrue(r.isClosed()); }
private void _testDoubles(JsonFactory f, double[] values, byte[] data, int offset, int readSize) throws IOException { AsyncReaderWrapper r = asyncForBytes(f, readSize, data, offset); // start with "no token" assertNull(r.currentToken()); assertToken(JsonToken.START_ARRAY, r.nextToken()); for (int i = 0; i < values.length; ++i) { assertToken(JsonToken.VALUE_NUMBER_FLOAT, r.nextToken()); assertEquals(String.format("Entry #%d: %s (textual '%s')", i, values[i], r.currentText()), values[i], r.getDoubleValue()); assertEquals(NumberType.DOUBLE, r.getNumberType()); } assertToken(JsonToken.END_ARRAY, r.nextToken()); // and end up with "no token" as well assertNull(r.nextToken()); assertTrue(r.isClosed()); }
private void _testBigIntegers(JsonFactory f, BigInteger[] values, byte[] data, int offset, int readSize) throws IOException { AsyncReaderWrapper r = asyncForBytes(f, readSize, data, offset); // start with "no token" assertNull(r.currentToken()); assertToken(JsonToken.START_ARRAY, r.nextToken()); for (int i = 0; i < values.length; ++i) { BigInteger expValue = values[i]; assertToken(JsonToken.VALUE_NUMBER_INT, r.nextToken()); assertEquals(expValue, r.getBigIntegerValue()); assertEquals(NumberType.BIG_INTEGER, r.getNumberType()); } assertToken(JsonToken.END_ARRAY, r.nextToken()); assertNull(r.nextToken()); assertTrue(r.isClosed()); }
private void _testBigDecimals(JsonFactory f, BigDecimal[] values, byte[] doc, int offset, int readSize) throws IOException { AsyncReaderWrapper r = asyncForBytes(f, readSize, doc, offset); // start with "no token" assertNull(r.currentToken()); assertToken(JsonToken.START_ARRAY, r.nextToken()); for (int i = 0; i < values.length; ++i) { BigDecimal expValue = values[i]; assertToken(JsonToken.VALUE_NUMBER_FLOAT, r.nextToken()); assertEquals(expValue, r.getDecimalValue()); assertEquals(NumberType.BIG_DECIMAL, r.getNumberType()); } assertToken(JsonToken.END_ARRAY, r.nextToken()); assertNull(r.nextToken()); assertTrue(r.isClosed()); }
protected boolean doLe(JsonNode propertyNode, JsonNode passedNode){ if(propertyNode.isNumber() && passedNode.isNumber() && propertyNode.numberType() == passedNode.numberType()) { Number propertyValue = propertyNode.numberValue(); Number passedValue = passedNode.numberValue(); if(propertyNode.numberType() == NumberType.INT) { return ((Integer) propertyValue <= (Integer) passedValue); } else if(propertyNode.numberType() == NumberType.LONG) { return ((Long) propertyValue <= (Long) passedValue); } else if(propertyNode.numberType() == NumberType.FLOAT) { return ((Float) propertyValue <= (Float) passedValue); } else if(propertyNode.numberType() == NumberType.DOUBLE) { return ((Double) propertyValue <= (Double) passedValue); } else { throw new UnsupportedExprException("Le supports only INT, LONG, DOUBLE, FLOAT values"); } } else { throw new UnsupportedExprException("Le supports only numeric values of same type for comparison"); } }
protected boolean doGt(JsonNode propertyNode, JsonNode passedNode){ if(propertyNode.isNumber() && passedNode.isNumber() && propertyNode.numberType() == passedNode.numberType()) { Number propertyValue = propertyNode.numberValue(); Number passedValue = passedNode.numberValue(); if(propertyNode.numberType() == NumberType.INT) { return ((Integer) propertyValue > (Integer) passedValue); } else if(propertyNode.numberType() == NumberType.LONG) { return ((Long) propertyValue > (Long) passedValue); } else if(propertyNode.numberType() == NumberType.FLOAT) { return ((Float) propertyValue > (Float) passedValue); } else if(propertyNode.numberType() == NumberType.DOUBLE) { return ((Double) propertyValue > (Double) passedValue); } else { throw new UnsupportedExprException("Gt supports only INT, LONG, DOUBLE, FLOAT values"); } } else { throw new UnsupportedExprException("Gt supports only numeric values of same type for comparison"); } }
protected boolean doLt(JsonNode propertyNode, JsonNode passedNode){ if(propertyNode.isNumber() && passedNode.isNumber() && propertyNode.numberType() == passedNode.numberType()) { Number propertyValue = propertyNode.numberValue(); Number passedValue = passedNode.numberValue(); if(propertyNode.numberType() == NumberType.INT) { return ((Integer) propertyValue < (Integer) passedValue); } else if(propertyNode.numberType() == NumberType.LONG) { return ((Long) propertyValue < (Long) passedValue); } else if(propertyNode.numberType() == NumberType.FLOAT) { return ((Float) propertyValue < (Float) passedValue); } else if(propertyNode.numberType() == NumberType.DOUBLE) { return ((Double) propertyValue < (Double) passedValue); } else { throw new UnsupportedExprException("Lt supports only INT, LONG, DOUBLE, FLOAT values"); } } else { throw new UnsupportedExprException("Lt supports only numeric values of same type for comparison"); } }
private boolean doGe(JsonNode propertyNode, JsonNode passedNode){ if(propertyNode.isNumber() && passedNode.isNumber() && propertyNode.numberType() == passedNode.numberType()) { Number propertyValue = propertyNode.numberValue(); Number passedValue = passedNode.numberValue(); if(propertyNode.numberType() == NumberType.INT) { return ((Integer) propertyValue >= (Integer) passedValue); } else if(propertyNode.numberType() == NumberType.LONG) { return ((Long) propertyValue >= (Long) passedValue); } else if(propertyNode.numberType() == NumberType.FLOAT) { return ((Float) propertyValue >= (Float) passedValue); } else if(propertyNode.numberType() == NumberType.DOUBLE) { return ((Double) propertyValue >=(Double) passedValue); } else { throw new UnsupportedExprException("Ge supports only INT, LONG, DOUBLE, FLOAT values"); } } else { throw new UnsupportedExprException("Ge supports only numeric values of same type for comparison"); } }
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType) { boolean bool1 = this._useTimestamp; boolean bool2 = bool1; if ((!bool1) && (this._customFormat == null)) bool2 = paramJsonFormatVisitorWrapper.getProvider().isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); if (bool2) { JsonIntegerFormatVisitor localJsonIntegerFormatVisitor = paramJsonFormatVisitorWrapper.expectIntegerFormat(paramJavaType); if (localJsonIntegerFormatVisitor != null) { localJsonIntegerFormatVisitor.numberType(JsonParser.NumberType.LONG); localJsonIntegerFormatVisitor.format(JsonValueFormat.UTC_MILLISEC); } return; } JsonStringFormatVisitor localJsonStringFormatVisitor = paramJsonFormatVisitorWrapper.expectStringFormat(paramJavaType); if (localJsonStringFormatVisitor != null) localJsonStringFormatVisitor.format(JsonValueFormat.DATE_TIME); }
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType) { if (paramJsonFormatVisitorWrapper.getProvider().isEnabled(SerializationFeature.WRITE_ENUMS_USING_INDEX)) { JsonIntegerFormatVisitor localJsonIntegerFormatVisitor = paramJsonFormatVisitorWrapper.expectIntegerFormat(paramJavaType); if (localJsonIntegerFormatVisitor != null) localJsonIntegerFormatVisitor.numberType(JsonParser.NumberType.INT); return; } JsonStringFormatVisitor localJsonStringFormatVisitor = paramJsonFormatVisitorWrapper.expectStringFormat(paramJavaType); if ((paramJavaType != null) && (localJsonStringFormatVisitor != null) && (paramJavaType.isEnumType())) { LinkedHashSet localLinkedHashSet = new LinkedHashSet(); Iterator localIterator = this._values.values().iterator(); while (localIterator.hasNext()) localLinkedHashSet.add(((SerializedString)localIterator.next()).getValue()); localJsonStringFormatVisitor.enumTypes(localLinkedHashSet); } }
protected final boolean _parseBooleanFromNumber(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext) { if (paramJsonParser.getNumberType() == JsonParser.NumberType.LONG) { Boolean localBoolean; if (paramJsonParser.getLongValue() == 0L) localBoolean = Boolean.FALSE; else localBoolean = Boolean.TRUE; return localBoolean.booleanValue(); } String str = paramJsonParser.getText(); if (("0.0".equals(str)) || ("0".equals(str))) return Boolean.FALSE.booleanValue(); return Boolean.TRUE.booleanValue(); }
protected final boolean _parseBooleanPrimitive(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext) { JsonToken localJsonToken = paramJsonParser.getCurrentToken(); if (localJsonToken == JsonToken.VALUE_TRUE) return true; if (localJsonToken == JsonToken.VALUE_FALSE) return false; if (localJsonToken == JsonToken.VALUE_NULL) return false; if (localJsonToken == JsonToken.VALUE_NUMBER_INT) { if (paramJsonParser.getNumberType() == JsonParser.NumberType.INT) return paramJsonParser.getIntValue() != 0; return _parseBooleanFromNumber(paramJsonParser, paramDeserializationContext); } if (localJsonToken == JsonToken.VALUE_STRING) { String str = paramJsonParser.getText().trim(); if ("true".equals(str)) return true; if (("false".equals(str)) || (str.length() == 0)) return Boolean.FALSE.booleanValue(); throw paramDeserializationContext.weirdStringException(str, this._valueClass, "only \"true\" or \"false\" recognized"); } throw paramDeserializationContext.mappingException(this._valueClass, localJsonToken); }
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 BigInteger)) return JsonParser.NumberType.BIG_INTEGER; if ((localNumber instanceof Float)) return JsonParser.NumberType.FLOAT; if ((localNumber instanceof Short)) return JsonParser.NumberType.INT; return null; }
private void _testNumbers(JsonFactory f, byte[] data, int offset, int readSize) throws IOException { AsyncReaderWrapper r = asyncForBytes(f, readSize, data, offset); // start with "no token" assertNull(r.currentToken()); assertToken(JsonToken.START_OBJECT, r.nextToken()); assertToken(JsonToken.FIELD_NAME, r.nextToken()); assertEquals("i1", r.currentText()); assertToken(JsonToken.VALUE_NUMBER_INT, r.nextToken()); assertEquals(NumberType.INT, r.getNumberType()); assertEquals(NUMBER_EXP_I, r.getIntValue()); assertEquals((double)NUMBER_EXP_I, r.getDoubleValue()); assertToken(JsonToken.FIELD_NAME, r.nextToken()); assertEquals("doubley", r.currentText()); assertToken(JsonToken.VALUE_NUMBER_FLOAT, r.nextToken()); assertEquals(NumberType.DOUBLE, r.getNumberType()); assertEquals(NUMBER_EXP_D, r.getDoubleValue()); assertEquals((long) NUMBER_EXP_D, r.getLongValue()); assertToken(JsonToken.FIELD_NAME, r.nextToken()); assertEquals("biggieDecimal", r.currentText()); assertToken(JsonToken.VALUE_NUMBER_FLOAT, r.nextToken()); // can't really tell double/BigDecimal apart in plain json assertEquals(NumberType.DOUBLE, r.getNumberType()); assertEquals(NUMBER_EXP_BD, r.getDecimalValue()); assertEquals(""+NUMBER_EXP_BD, r.currentText()); assertToken(JsonToken.END_OBJECT, r.nextToken()); // and end up with "no token" as well assertNull(r.nextToken()); assertTrue(r.isClosed()); }
private cfData parseArray(JsonParser jp, cfArrayData array, boolean bStrictMapping ) throws JsonParseException, IOException, cfmRunTimeException{ JsonToken token = jp.nextToken(); while ( token != JsonToken.END_ARRAY ){ if ( token == JsonToken.START_ARRAY ){ array.addElement( parseArray(jp,cfArrayData.createArray(1),bStrictMapping ) ); }else if ( token == JsonToken.START_OBJECT ){ array.addElement( parseObject(jp,new cfStructData(),bStrictMapping) ); }else if ( token == JsonToken.VALUE_NUMBER_INT ){ if ( jp.getNumberType() == NumberType.INT ) array.addElement( new cfNumberData(jp.getIntValue()) ); else if ( jp.getNumberType() == NumberType.LONG || jp.getNumberType() == NumberType.BIG_INTEGER ) array.addElement( new cfNumberData(jp.getLongValue()) ); }else if ( token == JsonToken.VALUE_NUMBER_FLOAT ){ if ( jp.getNumberType() == NumberType.FLOAT ) array.addElement( new cfNumberData(jp.getFloatValue()) ); else if ( jp.getNumberType() == NumberType.DOUBLE ) array.addElement( new cfNumberData(jp.getDoubleValue()) ); } else if ( token == JsonToken.VALUE_FALSE ){ array.addElement( cfBooleanData.FALSE ); } else if ( token == JsonToken.VALUE_TRUE ){ array.addElement( cfBooleanData.TRUE ); } else if ( token == JsonToken.VALUE_NULL ){ array.addElement( cfNullData.NULL ); }else array.addElement( getString(jp.getText()) ); token = jp.nextToken(); } return array; }
protected final Boolean _parseBoolean(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext) { JsonToken localJsonToken = paramJsonParser.getCurrentToken(); if (localJsonToken == JsonToken.VALUE_TRUE) return Boolean.TRUE; if (localJsonToken == JsonToken.VALUE_FALSE) return Boolean.FALSE; if (localJsonToken == JsonToken.VALUE_NUMBER_INT) { if (paramJsonParser.getNumberType() == JsonParser.NumberType.INT) { if (paramJsonParser.getIntValue() == 0) return Boolean.FALSE; return Boolean.TRUE; } return Boolean.valueOf(_parseBooleanFromNumber(paramJsonParser, paramDeserializationContext)); } if (localJsonToken == JsonToken.VALUE_NULL) return (Boolean)getNullValue(); if (localJsonToken == JsonToken.VALUE_STRING) { String str = paramJsonParser.getText().trim(); if ("true".equals(str)) return Boolean.TRUE; if ("false".equals(str)) return Boolean.FALSE; if (str.length() == 0) return (Boolean)getEmptyValue(); throw paramDeserializationContext.weirdStringException(str, this._valueClass, "only \"true\" or \"false\" recognized"); } throw paramDeserializationContext.mappingException(this._valueClass, localJsonToken); }
public final BigInteger getBigIntegerValue() { Number localNumber = getNumberValue(); if ((localNumber instanceof BigInteger)) return (BigInteger)localNumber; if (getNumberType() == JsonParser.NumberType.BIG_DECIMAL) return ((BigDecimal)localNumber).toBigInteger(); return BigInteger.valueOf(localNumber.longValue()); }
public JsonParser.NumberType getNumberType() { JsonNode localJsonNode = currentNumericNode(); if (localJsonNode == null) return null; return localJsonNode.numberType(); }
private Serializable getValue (JsonParser parser, JsonToken token) throws IOException { if (token != null) { switch (token) { case VALUE_STRING: return parser.getText (); case VALUE_NUMBER_INT: if (parser.getNumberType () == NumberType.INT || parser.getNumberType () == NumberType.LONG) { return Long.valueOf (parser.getLongValue ()); } else { return parser.getNumberValue (); } case VALUE_NUMBER_FLOAT: if (parser.getNumberType () == NumberType.FLOAT) { return Float.valueOf (parser.getFloatValue ()); } else if (parser.getNumberType () == NumberType.DOUBLE) { return Double.valueOf (parser.getDoubleValue ()); } else { return parser.getNumberValue (); } case VALUE_TRUE: return Boolean.TRUE; case VALUE_FALSE: return Boolean.FALSE; case VALUE_NULL: return null; case END_ARRAY: default: break; } } return null; }
protected final boolean _parseBooleanPrimitive(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonToken t = jp.getCurrentToken(); if (t == JsonToken.VALUE_TRUE) { return true; } if (t == JsonToken.VALUE_FALSE) { return false; } if (t == JsonToken.VALUE_NULL) { return false; } // [JACKSON-78]: should accept ints too, (0 == false, otherwise true) if (t == JsonToken.VALUE_NUMBER_INT) { // 11-Jan-2012, tatus: May be outside of int... if (jp.getNumberType() == NumberType.INT) { return (jp.getIntValue() != 0); } return _parseBooleanFromNumber(jp, ctxt); } // And finally, let's allow Strings to be converted too if (t == JsonToken.VALUE_STRING) { String text = jp.getText().trim(); if ("true".equals(text)) { return true; } if ("false".equals(text) || text.length() == 0) { return Boolean.FALSE; } throw ctxt.weirdStringException(text, _valueClass, "only \"true\" or \"false\" recognized"); } // Otherwise, no can do: throw ctxt.mappingException(_valueClass, t); }
protected final Boolean _parseBoolean(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonToken t = jp.getCurrentToken(); if (t == JsonToken.VALUE_TRUE) { return Boolean.TRUE; } if (t == JsonToken.VALUE_FALSE) { return Boolean.FALSE; } // [JACKSON-78]: should accept ints too, (0 == false, otherwise true) if (t == JsonToken.VALUE_NUMBER_INT) { // 11-Jan-2012, tatus: May be outside of int... if (jp.getNumberType() == NumberType.INT) { return (jp.getIntValue() == 0) ? Boolean.FALSE : Boolean.TRUE; } return Boolean.valueOf(_parseBooleanFromNumber(jp, ctxt)); } if (t == JsonToken.VALUE_NULL) { return (Boolean) getNullValue(); } // And finally, let's allow Strings to be converted too if (t == JsonToken.VALUE_STRING) { String text = jp.getText().trim(); if ("true".equals(text)) { return Boolean.TRUE; } if ("false".equals(text)) { return Boolean.FALSE; } if (text.length() == 0) { return (Boolean) getEmptyValue(); } throw ctxt.weirdStringException(text, _valueClass, "only \"true\" or \"false\" recognized"); } // Otherwise, no can do: throw ctxt.mappingException(_valueClass, t); }
protected final boolean _parseBooleanFromNumber(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { if (jp.getNumberType() == NumberType.LONG) { return (jp.getLongValue() == 0L) ? Boolean.FALSE : Boolean.TRUE; } // no really good logic; let's actually resort to textual comparison String str = jp.getText(); if ("0.0".equals(str) || "0".equals(str)) { return Boolean.FALSE; } return Boolean.TRUE; }
@Override public NumberType numberType() { return null; }
private void setNumberField(JsonParser jp, JSONToPdxMapper 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; } }
private cfData parseObject(JsonParser jp, cfStructData struct, boolean bStrictMapping ) throws JsonParseException, IOException, cfmRunTimeException{ JsonToken token = jp.nextToken(); while ( token != JsonToken.END_OBJECT ){ String namefield = jp.getCurrentName(); if ( token == JsonToken.START_ARRAY ){ struct.setData( namefield, parseArray(jp, cfArrayData.createArray(1), bStrictMapping) ); }else if ( token == JsonToken.START_OBJECT ){ struct.setData( namefield, parseObject(jp,new cfStructData(), bStrictMapping) ); }else if ( token == JsonToken.VALUE_NUMBER_INT ){ if ( jp.getNumberType() == NumberType.INT ) struct.setData( namefield, new cfNumberData(jp.getIntValue()) ); else if ( jp.getNumberType() == NumberType.LONG || jp.getNumberType() == NumberType.BIG_INTEGER ) struct.setData( namefield, new cfNumberData(jp.getLongValue()) ); }else if ( token == JsonToken.VALUE_NUMBER_FLOAT ){ if ( jp.getNumberType() == NumberType.FLOAT ) struct.setData( namefield, new cfNumberData(jp.getFloatValue()) ); else if ( jp.getNumberType() == NumberType.DOUBLE ) struct.setData( namefield, new cfNumberData(jp.getDoubleValue()) ); } else if ( token == JsonToken.VALUE_FALSE ){ struct.setData( namefield, cfBooleanData.FALSE ); } else if ( token == JsonToken.VALUE_TRUE ){ struct.setData( namefield, cfBooleanData.TRUE ); } else if ( token == JsonToken.VALUE_NULL ){ struct.setData( namefield, cfNullData.NULL ); }else{ struct.setData( namefield, getString(jp.getText()) ); } token = jp.nextToken(); } if ( bStrictMapping ) return convertToQuery( struct ); else return struct; }
public final void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType) { JsonIntegerFormatVisitor localJsonIntegerFormatVisitor = paramJsonFormatVisitorWrapper.expectIntegerFormat(paramJavaType); if (localJsonIntegerFormatVisitor != null) localJsonIntegerFormatVisitor.numberType(JsonParser.NumberType.INT); }
public final void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType) { JsonIntegerFormatVisitor localJsonIntegerFormatVisitor = paramJsonFormatVisitorWrapper.expectIntegerFormat(paramJavaType); if (localJsonIntegerFormatVisitor != null) localJsonIntegerFormatVisitor.numberType(JsonParser.NumberType.LONG); }
public final void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType) { JsonNumberFormatVisitor localJsonNumberFormatVisitor = paramJsonFormatVisitorWrapper.expectNumberFormat(paramJavaType); if (localJsonNumberFormatVisitor != null) localJsonNumberFormatVisitor.numberType(JsonParser.NumberType.DOUBLE); }
public final void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType) { JsonNumberFormatVisitor localJsonNumberFormatVisitor = paramJsonFormatVisitorWrapper.expectNumberFormat(paramJavaType); if (localJsonNumberFormatVisitor != null) localJsonNumberFormatVisitor.numberType(JsonParser.NumberType.FLOAT); }
public final void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType) { JsonNumberFormatVisitor localJsonNumberFormatVisitor = paramJsonFormatVisitorWrapper.expectNumberFormat(paramJavaType); if (localJsonNumberFormatVisitor != null) localJsonNumberFormatVisitor.numberType(JsonParser.NumberType.BIG_DECIMAL); }
public void numberType(JsonParser.NumberType paramNumberType) { }
public final JsonParser.NumberType numberType() { return JsonParser.NumberType.LONG; }