@Test public void testNonPeriodInput() { for (CellProcessor p : processors) { try { p.execute(123, ANONYMOUS_CSVCONTEXT); fail("expecting SuperCsvCellProcessorException"); } catch (SuperCsvCellProcessorException e) { assertEquals( "the input value should be of type org.joda.time.Period but is java.lang.Integer", e.getMessage()); } } }
public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); if (!(value instanceof Period)) { throw new SuperCsvCellProcessorException(Period.class, value, context, this); } final Period period = (Period) value; final String result; if (formatter != null) { result = period.toString(formatter); } else { result = period.toString(); } return next.execute(result, context); }
FmtPeriod extends CellProcessorAdaptor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); if (!(value instanceof Period)) { throw new SuperCsvCellProcessorException(Period.class, value, context, this); } final Period period = (Period) value; final String result; if (formatter != null) { result = period.toString(formatter); } else { result = period.toString(); } return next.execute(result, context); } }
FmtPeriod extends CellProcessorAdaptor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); if (!(value instanceof Period)) { throw new SuperCsvCellProcessorException(Period.class, value, context, this); } final Period period = (Period) value; final String result; if (formatter != null) { result = period.toString(formatter); } else { result = period.toString(); } return next.execute(result, context); } FmtPeriod();  FmtPeriod(final CellProcessor next);  FmtPeriod(final PeriodFormatter formatter);  FmtPeriod(final PeriodFormatter formatter, final CellProcessor next); }
FmtPeriod extends CellProcessorAdaptor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); if (!(value instanceof Period)) { throw new SuperCsvCellProcessorException(Period.class, value, context, this); } final Period period = (Period) value; final String result; if (formatter != null) { result = period.toString(formatter); } else { result = period.toString(); } return next.execute(result, context); } FmtPeriod();  FmtPeriod(final CellProcessor next);  FmtPeriod(final PeriodFormatter formatter);  FmtPeriod(final PeriodFormatter formatter, final CellProcessor next); Object execute(final Object value, final CsvContext context); }
FmtPeriod extends CellProcessorAdaptor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); if (!(value instanceof Period)) { throw new SuperCsvCellProcessorException(Period.class, value, context, this); } final Period period = (Period) value; final String result; if (formatter != null) { result = period.toString(formatter); } else { result = period.toString(); } return next.execute(result, context); } FmtPeriod();  FmtPeriod(final CellProcessor next);  FmtPeriod(final PeriodFormatter formatter);  FmtPeriod(final PeriodFormatter formatter, final CellProcessor next); Object execute(final Object value, final CsvContext context);  }