@Test public void testValidInputWithGroupingSeparator() { String normalInput = "1,357.459"; String germanInput = "1.357,459"; BigDecimal expectedOutput = new BigDecimal("1357.459"); for( CellProcessor p : Arrays.asList(processor, processorChain) ) { try { p.execute(normalInput, ANONYMOUS_CSVCONTEXT); fail("should have thrown SuperCsvCellProcessorException"); } catch(SuperCsvCellProcessorException e) {} } for( final CellProcessor p : Arrays.asList(processor2, processorChain2) ) { assertExecution(p, normalInput, expectedOutput); } for( final CellProcessor p : Arrays.asList(processor3, processorChain3) ) { assertExecution(p, germanInput, expectedOutput); } }
public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final BigDecimal result; if( value instanceof String ) { final String s = (String) value; try { if( symbols == null ) { result = new BigDecimal(s); } else { result = new BigDecimal(fixSymbols(s, symbols)); } } catch(final NumberFormatException e) { throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as a BigDecimal", value), context, this, e); } } else { throw new SuperCsvCellProcessorException(String.class, value, context, this); } return next.execute(result, context); }
ParseBigDecimal extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final BigDecimal result; if( value instanceof String ) { final String s = (String) value; try { if( symbols == null ) { result = new BigDecimal(s); } else { result = new BigDecimal(fixSymbols(s, symbols)); } } catch(final NumberFormatException e) { throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as a BigDecimal", value), context, this, e); } } else { throw new SuperCsvCellProcessorException(String.class, value, context, this); } return next.execute(result, context); } }
ParseBigDecimal extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final BigDecimal result; if( value instanceof String ) { final String s = (String) value; try { if( symbols == null ) { result = new BigDecimal(s); } else { result = new BigDecimal(fixSymbols(s, symbols)); } } catch(final NumberFormatException e) { throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as a BigDecimal", value), context, this, e); } } else { throw new SuperCsvCellProcessorException(String.class, value, context, this); } return next.execute(result, context); } ParseBigDecimal();  ParseBigDecimal(final DecimalFormatSymbols symbols);  ParseBigDecimal(final CellProcessor next);  ParseBigDecimal(final DecimalFormatSymbols symbols, final CellProcessor next); }
ParseBigDecimal extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final BigDecimal result; if( value instanceof String ) { final String s = (String) value; try { if( symbols == null ) { result = new BigDecimal(s); } else { result = new BigDecimal(fixSymbols(s, symbols)); } } catch(final NumberFormatException e) { throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as a BigDecimal", value), context, this, e); } } else { throw new SuperCsvCellProcessorException(String.class, value, context, this); } return next.execute(result, context); } ParseBigDecimal();  ParseBigDecimal(final DecimalFormatSymbols symbols);  ParseBigDecimal(final CellProcessor next);  ParseBigDecimal(final DecimalFormatSymbols symbols, final CellProcessor next); Object execute(final Object value, final CsvContext context); }
ParseBigDecimal extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final BigDecimal result; if( value instanceof String ) { final String s = (String) value; try { if( symbols == null ) { result = new BigDecimal(s); } else { result = new BigDecimal(fixSymbols(s, symbols)); } } catch(final NumberFormatException e) { throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as a BigDecimal", value), context, this, e); } } else { throw new SuperCsvCellProcessorException(String.class, value, context, this); } return next.execute(result, context); } ParseBigDecimal();  ParseBigDecimal(final DecimalFormatSymbols symbols);  ParseBigDecimal(final CellProcessor next);  ParseBigDecimal(final DecimalFormatSymbols symbols, final CellProcessor next); Object execute(final Object value, final CsvContext context);  }