protected void reportInvalidNumber(String msg) throws JsonParseException { _reportError("Invalid numeric value: "+msg); }
protected void reportInvalidNumber(String msg) throws JsonParseException { _reportError("Invalid numeric value: "+msg); }
protected void reportUnexpectedNumberChar(int ch, String comment) throws JsonParseException { String msg = "Unexpected character ("+_getCharDesc(ch)+") in numeric value"; if (comment != null) { msg += ": "+comment; } _reportError(msg); }
protected void reportOverflowLong() throws IOException, JsonParseException { _reportError("Numeric value ("+getText()+") out of range of long ("+Long.MIN_VALUE+" - "+Long.MAX_VALUE+")"); }
protected void reportUnexpectedNumberChar(int ch, String comment) throws JsonParseException { String msg = "Unexpected character ("+_getCharDesc(ch)+") in numeric value"; if (comment != null) { msg += ": "+comment; } _reportError(msg); }
protected void reportOverflowInt() throws IOException, JsonParseException { _reportError("Numeric value ("+getText()+") out of range of int ("+Integer.MIN_VALUE+" - "+Integer.MAX_VALUE+")"); }
protected void reportOverflowInt() throws IOException, JsonParseException { _reportError("Numeric value ("+getText()+") out of range of int ("+Integer.MIN_VALUE+" - "+Integer.MAX_VALUE+")"); }
protected void reportOverflowLong() throws IOException, JsonParseException { _reportError("Numeric value ("+getText()+") out of range of long ("+Long.MIN_VALUE+" - "+Long.MAX_VALUE+")"); } }
_reportError("Numeric value ("+getText()+") out of range of int");
protected void convertNumberToInt() throws IOException, JsonParseException { // First, converting from long ought to be easy if ((mNumTypesValid & NR_LONG) != 0) { // Let's verify it's lossless conversion by simple roundtrip int result = (int) mNumberLong; if (((long) result) != mNumberLong) { _reportError("Numeric value ("+getText()+") out of range of int"); } mNumberInt = result; } else if ((mNumTypesValid & NR_DOUBLE) != 0) { // Need to check boundaries if (mNumberDouble < MIN_INT_D || mNumberDouble > MAX_INT_D) { reportOverflowInt(); } mNumberInt = (int) mNumberDouble; } else if ((mNumTypesValid & NR_BIGDECIMAL) != 0) { if (BD_MIN_INT.compareTo(mNumberBigDecimal) > 0 || BD_MAX_INT.compareTo(mNumberBigDecimal) < 0) { reportOverflowInt(); } mNumberInt = mNumberBigDecimal.intValue(); } else { _throwInternal(); // should never get here } mNumTypesValid |= NR_INT; }
_reportError("Current token ("+_currToken+") not numeric, can not use numeric value accessors");
return; _reportError("Current token ("+_currToken+") not numeric, can not use numeric value accessors");