Examples of SuperCSVException


Examples of org.supercsv.exception.SuperCSVException

                    result = new BigDecimal((String) value);
                }
            }
        }
    catch(final Exception e) {
      throw new SuperCSVException("Parser error", context, this, e);
    }
  } else {
    throw new SuperCSVException("Can't convert \"" + value
      + "\" to a BigDecimal. Input is not of type String, but of type " + value.getClass().getName(), context,
      this);
  }
 
  return next.execute(result, context);
View Full Code Here

Examples of org.supercsv.exception.SuperCSVException

  } else if( value instanceof String ) {
    final String tmp = (String) value;
    if( tmp.length() == 1 ) {
      result = Character.valueOf(tmp.charAt(0));
    } else {
      throw new SuperCSVException("Can't convert \"" + value
        + "\" to a char. It must have a length of 1 to be a valid char.", context, this);
    }
  } else {
    throw new SuperCSVException("Can't convert \"" + value
      + "\" to char. Input is not of type Character nor type String, but of type " + value.getClass().getName(),
      context, this);
  }
 
  return next.execute(result, context);
View Full Code Here

Examples of org.supercsv.exception.SuperCSVException

  try {
    final Date result = formatter.parse((String) value);
    return next.execute(result, context);
  }
  catch(final ParseException e) {
    throw new SuperCSVException("Problems parsing '" + value + "' as a date", context, this, e);
  }
}
View Full Code Here

Examples of org.supercsv.exception.SuperCSVException

  if( isFalseValue(sval) ) {
    result = Boolean.FALSE;
  } else if( isTrueValue(sval) ) {
    result = Boolean.TRUE;
  } else {
    throw new SuperCSVException("Cannot parse \"" + value + "\" to a boolean on line " + context.lineNumber
      + " column " + context.columnNumber, context, this);
  }
 
  return next.execute(result, context);
}
View Full Code Here

Examples of org.supercsv.exception.SuperCSVException

  }
  if( replaceText == null ) {
    throw new NullInputException("replacettext cannot be null", this);
  }
  if( searchText.equals("") ) {
    throw new SuperCSVException("argument searchText cannot be \"\" as this has no effect", this);
  }
  this.searchText = searchText;
  this.replaceText = replaceText;
}
View Full Code Here

Examples of org.supercsv.exception.SuperCSVException

    if( value instanceof String ) {
      try {
        result = Long.parseLong((String) value);
      }
      catch(final NumberFormatException e) {
        throw new SuperCSVException("Parser error", context, this, e);
      }
    }
    else {
      throw new SuperCSVException("Can't convert \"" + value
        + "\" to long. Input is not of type Long nor type String but of type " + value.getClass().getName(),
        context, this);
    }
 
  return next.execute(result, context);
View Full Code Here

Examples of org.supercsv.exception.SuperCSVException

String trimPostfix = "";

/** Trim strings to ensure a maximum size */
public Trim(final int maxSize) {
  super(NullObjectPattern.INSTANCE);
  if( maxSize < 1 ) { throw new SuperCSVException("argument maxSize must be > 0", this); }
  this.maxSize = maxSize;
}
View Full Code Here

Examples of org.supercsv.exception.SuperCSVException

 
  final int delimiter = preference.getDelimiterChar();
  int i = 0;
  switch( content.length ) {
  case 0:
    throw new SuperCSVException("There is no content to write for line " + getLineNumber(), new CSVContext(
      getLineNumber(), 0));
   
  case 1: // just write last element after switch
    break;
 
View Full Code Here

Examples of org.supercsv.exception.SuperCSVException

        p = -1; // reset delta to point to start of new line (set to
        // -1 as it will be incremented to 0 at the end of
        // the switch)
        line = lnr.readLine();
        if( line == null ) {
          throw new SuperCSVException(
            "File ended unexpectedly while reading a quoted cell starting on line: " + linenoQuoteState,
            new CSVContext(linenoQuoteState, 0));
        }
        line += '\n'; // add \n to make parsing easy
        break; // read more
View Full Code Here

Examples of org.supercsv.exception.SuperCSVException

        // .get(i).getClass(), lineResult.get(i)));
        cache.getSetMethod(resultBean, nameMapping[i], lineResult.get(i).getClass())//
          .invoke(resultBean, lineResult.get(i));
      }
      catch(final IllegalArgumentException e) {
        throw new SuperCSVException("Method set" + nameMapping[i].substring(0, 1).toUpperCase()
          + nameMapping[i].substring(1) + "() does not accept input \"" + lineResult.get(i) + "\" of type "
          + lineResult.get(i).getClass().getName(), null, e);
      }
    }
    return resultBean;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.