@Test public void testValidString() { assertEquals(IN_RANGE, processor.execute(String.valueOf(IN_RANGE), ANONYMOUS_CSVCONTEXT)); assertEquals(IN_RANGE, processorChain.execute(String.valueOf(IN_RANGE), ANONYMOUS_CSVCONTEXT)); }
public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final Double result; if( value instanceof Double ) { result = (Double) value; } else { try { result = Double.parseDouble(value.toString()); } catch(final NumberFormatException e) { throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as a Double", value), context, this, e); } } if( result < min || result > max ) { throw new SuperCsvConstraintViolationException(String.format( "%f does not lie between the min (%f) and max (%f) values (inclusive)", result, min, max), context, this); } return next.execute(result, context); }
DMinMax extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final Double result; if( value instanceof Double ) { result = (Double) value; } else { try { result = Double.parseDouble(value.toString()); } catch(final NumberFormatException e) { throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as a Double", value), context, this, e); } } if( result < min || result > max ) { throw new SuperCsvConstraintViolationException(String.format( "%f does not lie between the min (%f) and max (%f) values (inclusive)", result, min, max), context, this); } return next.execute(result, context); } }
DMinMax extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final Double result; if( value instanceof Double ) { result = (Double) value; } else { try { result = Double.parseDouble(value.toString()); } catch(final NumberFormatException e) { throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as a Double", value), context, this, e); } } if( result < min || result > max ) { throw new SuperCsvConstraintViolationException(String.format( "%f does not lie between the min (%f) and max (%f) values (inclusive)", result, min, max), context, this); } return next.execute(result, context); } DMinMax(final double min, final double max);  DMinMax(final double min, final double max, final DoubleCellProcessor next); }
DMinMax extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final Double result; if( value instanceof Double ) { result = (Double) value; } else { try { result = Double.parseDouble(value.toString()); } catch(final NumberFormatException e) { throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as a Double", value), context, this, e); } } if( result < min || result > max ) { throw new SuperCsvConstraintViolationException(String.format( "%f does not lie between the min (%f) and max (%f) values (inclusive)", result, min, max), context, this); } return next.execute(result, context); } DMinMax(final double min, final double max);  DMinMax(final double min, final double max, final DoubleCellProcessor next); Object execute(final Object value, final CsvContext context); }
DMinMax extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final Double result; if( value instanceof Double ) { result = (Double) value; } else { try { result = Double.parseDouble(value.toString()); } catch(final NumberFormatException e) { throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as a Double", value), context, this, e); } } if( result < min || result > max ) { throw new SuperCsvConstraintViolationException(String.format( "%f does not lie between the min (%f) and max (%f) values (inclusive)", result, min, max), context, this); } return next.execute(result, context); } DMinMax(final double min, final double max);  DMinMax(final double min, final double max, final DoubleCellProcessor next); Object execute(final Object value, final CsvContext context); static final double MAX_DOUBLE; static final double MIN_DOUBLE; static final double MAX_SHORT; static final double MIN_SHORT; static final double MAX_CHAR; static final double MIN_CHAR; static final int MAX_8_BIT_UNSIGNED; static final int MIN_8_BIT_UNSIGNED; static final int MAX_8_BIT_SIGNED; static final int MIN_8_BIT_SIGNED; }