Пример #1
0
 @Override
 public void emit(ShortOption option) throws IOException {
   startCell();
   if (emitNull(option)) {
     return;
   }
   lineBuffer.append(option.get());
 }
Пример #2
0
 @SuppressWarnings("deprecation")
 private void fill0(ShortOption option, boolean doRecover) throws CsvFormatException {
   if (lineBuffer.hasRemaining()) {
     try {
       short value = Short.parseShort(lineBuffer.toString());
       option.modify(value);
     } catch (NumberFormatException e) {
       if (doRecover && trimWhitespaces()) {
         fill0(option, false);
         return;
       }
       throw new CsvFormatException(
           createStatusInLine(Reason.INVALID_CELL_FORMAT, "short value"), e);
     }
   } else {
     option.setNull();
   }
 }