Package org.supercsv.exception

Examples of org.supercsv.exception.ClassCastInputCSVException


*/
@Override
public Object execute(final Object value, final CSVContext context) throws SuperCSVException {
  if( value == null ) { throw new NullInputException("Input cannot be null on line " + context.lineNumber
    + " column " + context.columnNumber, context, this); }
  if( !(value instanceof Date) ) { throw new ClassCastInputCSVException("the value '" + value
    + "' is not of type Date", context, this); }
  final String result = formatter.format((Date) value);
  return next.execute(result, context);
}
View Full Code Here


  if( value == null ) {
    throw new NullInputException("Input cannot be null on line " + context.lineNumber + " column "
      + context.columnNumber, context, this);
  }
  if( !(value instanceof Boolean) ) {
    throw new ClassCastInputCSVException("the value '" + value + "' is not of type Boolean", context, this);
  }
  String result = ((Boolean) value).booleanValue() ? trueValue : falseValue;
  return next.execute(result, context);
}
View Full Code Here

@Override
public Object execute(final Object value, final CSVContext context) throws SuperCSVException {
  if( value == null ) { throw new NullInputException("Input cannot be null on line " + context.lineNumber
    + " column " + context.columnNumber, context, this); }
 
  if( !(value instanceof Number) ) { throw new ClassCastInputCSVException("the value '" + value
    + "' is not of type Number", context, this); }
 
  final String result = formatter.format(value);
  return next.execute(result, context);
}
View Full Code Here

    + " at column " + context.columnNumber, context, this); }
  if( value instanceof String ) {
    String svalue = (String) value;
    if( svalue.length() == 0 ) { throw new SuperCSVException("unexpected empty string", context, this); }
  } else {
    throw new ClassCastInputCSVException(value, String.class, context, this);
  }
 
  return next.execute(value, context);
}
View Full Code Here

TOP

Related Classes of org.supercsv.exception.ClassCastInputCSVException

Copyright © 2018 www.massapicom. 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.