protected Number parse(String value, DecimalFormat formatter) {
        ParsePosition pos = new ParsePosition(0);
        Number parsedValue = formatter.parse(value, pos);
        if (pos.getErrorIndex() > -1) {
            return null;
        }

        if (pos.getIndex() < value.length()) {
            return null;
        }

        if (parsedValue != null) {
            if (Double.isInfinite(parsedValue.doubleValue())) {
                return null;
            }
            parsedValue = processParsedValue(parsedValue, formatter);
        }

        return parsedValue;
    }
<p>
Parse the value with the specified <code>DecimalFormat</code>.
</p>

@param value The value to be parsed.
@param formatter The Format to parse the value with.
@return The parsed value if valid or <code>null</code> if invalid.
primefaces/src/main/java/org/primefaces/util/BigDecimalValidator.java