@Test(expected = SuperCsvCellProcessorException.class) public void testEmptyString() { String input = ""; assertEquals(input, processor.execute(input, ANONYMOUS_CSVCONTEXT)); }
public Object execute(final Object value, final CsvContext context) { if (value == null){ throw new SuperCsvConstraintViolationException("the String should not be null", context, this); } if( value instanceof String ) { final String stringValue = (String) value; if( stringValue.length() == 0 ) { throw new SuperCsvConstraintViolationException("the String should not be empty", context, this); } } else { throw new SuperCsvCellProcessorException(String.class, value, context, this); } return next.execute(value, context); }
StrNotNullOrEmpty extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { if (value == null){ throw new SuperCsvConstraintViolationException("the String should not be null", context, this); } if( value instanceof String ) { final String stringValue = (String) value; if( stringValue.length() == 0 ) { throw new SuperCsvConstraintViolationException("the String should not be empty", context, this); } } else { throw new SuperCsvCellProcessorException(String.class, value, context, this); } return next.execute(value, context); } }
StrNotNullOrEmpty extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { if (value == null){ throw new SuperCsvConstraintViolationException("the String should not be null", context, this); } if( value instanceof String ) { final String stringValue = (String) value; if( stringValue.length() == 0 ) { throw new SuperCsvConstraintViolationException("the String should not be empty", context, this); } } else { throw new SuperCsvCellProcessorException(String.class, value, context, this); } return next.execute(value, context); } StrNotNullOrEmpty();  StrNotNullOrEmpty(final CellProcessor next); }
StrNotNullOrEmpty extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { if (value == null){ throw new SuperCsvConstraintViolationException("the String should not be null", context, this); } if( value instanceof String ) { final String stringValue = (String) value; if( stringValue.length() == 0 ) { throw new SuperCsvConstraintViolationException("the String should not be empty", context, this); } } else { throw new SuperCsvCellProcessorException(String.class, value, context, this); } return next.execute(value, context); } StrNotNullOrEmpty();  StrNotNullOrEmpty(final CellProcessor next); Object execute(final Object value, final CsvContext context); }
StrNotNullOrEmpty extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { if (value == null){ throw new SuperCsvConstraintViolationException("the String should not be null", context, this); } if( value instanceof String ) { final String stringValue = (String) value; if( stringValue.length() == 0 ) { throw new SuperCsvConstraintViolationException("the String should not be empty", context, this); } } else { throw new SuperCsvCellProcessorException(String.class, value, context, this); } return next.execute(value, context); } StrNotNullOrEmpty();  StrNotNullOrEmpty(final CellProcessor next); Object execute(final Object value, final CsvContext context);  }