code: public BigDecimal nextBigDecimal() {
          // Check cached result
          if ((typeCache != null) && (typeCache instanceof BigDecimal)) {
              BigDecimal val = (BigDecimal)typeCache;
              useTypeCache();
              return val;
          }
          setRadix(10);
          clearCaches();
          // Search for next float
          try {
              String s = processFloatToken(next(decimalPattern()));
              return new BigDecimal(s);
          } catch (NumberFormatException nfe) {
              position = matcher.start(); // don't skip bad token
              throw new InputMismatchException(nfe.getMessage());
          }
      }
docs: Scans the next token of the input as a {@link java.math.BigDecimal
  BigDecimal}.
  
  <p> If the next token matches the <a
  href="#Decimal-regex"><i>Decimal</i></a> regular expression defined
  above then the token is converted into a <tt>BigDecimal</tt> value as if
  by removing all group separators, mapping non-ASCII digits into ASCII
  digits via the {@link Character#digit Character.digit}, and passing the
  resulting string to the {@link
  java.math.BigDecimal#BigDecimal(java.lang.String) BigDecimal(String)}
  constructor.
  
  @return the <tt>BigDecimal</tt> scanned from the input
  @throws InputMismatchException
  if the next token does not match the <i>Decimal</i>
  regular expression, or is out of range
  @throws NoSuchElementException if the input is exhausted
  @throws IllegalStateException if this scanner is closed