コード例 #1
0
 protected final void parseNumericValue(int i) throws JsonParseException {
   if (_currToken == null || !_currToken.isNumeric())
     _reportError(
         (new StringBuilder())
             .append("Current token (")
             .append(_currToken)
             .append(") not numeric, can not use numeric value accessors")
             .toString());
   try {
     if (_currToken != JsonToken.VALUE_NUMBER_INT) break MISSING_BLOCK_LABEL_248;
     char ac[] = _textBuffer.getTextBuffer();
     int j = _textBuffer.getTextOffset();
     if (_numberNegative) j++;
     if (mIntLength <= 9) {
       int k = NumberInput.parseInt(ac, j, mIntLength);
       if (_numberNegative) k = -k;
       _numberInt = k;
       _numTypesValid = 1;
       break MISSING_BLOCK_LABEL_291;
     }
     if (mIntLength <= 18) {
       long l = NumberInput.parseLong(ac, j, mIntLength);
       if (_numberNegative) l = -l;
       _numberLong = l;
       _numTypesValid = 2;
       break MISSING_BLOCK_LABEL_291;
     }
   } catch (NumberFormatException numberformatexception) {
     _wrapError(
         (new StringBuilder())
             .append("Malformed numeric value '")
             .append(_textBuffer.contentsAsString())
             .append("'")
             .toString(),
         numberformatexception);
     break MISSING_BLOCK_LABEL_291;
   }
   _numberBigInt = new BigInteger(_textBuffer.contentsAsString());
   _numTypesValid = 4;
   break MISSING_BLOCK_LABEL_291;
   if (i == 16) {
     _numberBigDecimal = _textBuffer.contentsAsDecimal();
     _numTypesValid = 16;
   } else {
     _numberDouble = _textBuffer.contentsAsDouble();
     _numTypesValid = 8;
   }
 }