Package org.supercsv.exception

Examples of org.supercsv.exception.NullInputException


* {@inheritDoc}
*/
@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 Boolean) ) {
    throw new ClassCastInputCSVException("the value '" + value + "' is not of type Boolean", context, this);
  }
View Full Code Here


/**
* {@inheritDoc}
*/
@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 + " at column " + context.columnNumber, context, this); }
  final BigDecimal result;
  if( value instanceof String ) {
    try {
            if (symbols == null) {
                result = new BigDecimal((String) value);
View Full Code Here

/**
* {@inheritDoc}
*/
@Override
public Object execute(final Object value, final CSVContext context) {
  if( value == null ) { throw new NullInputException("Input cannot be null on line " + context.lineNumber + " at column " + context.columnNumber, context, this); }
  final Character result;
  if( value instanceof Character ) {
    result = (Character) value;
  } else if( value instanceof String ) {
    final String tmp = (String) value;
View Full Code Here

* @param next
*/
protected CellProcessorAdaptor(final CellProcessor next) {
  super();
  if( next == null ) {
    throw new NullInputException("argument was null", this);
  }
 
  this.next = next;
}
View Full Code Here

* {@inheritDoc}
*/
@Override
public Object execute(final Object value, final CSVContext context) {
  if( value == null ) {
    throw new NullInputException("Input cannot be null on line " + context.lineNumber + " at column "
      + context.columnNumber, context, this);
  }
  if( value.equals(token) ) {
    return returnValue;
  }
View Full Code Here

* {@inheritDoc}
*/
@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 + " at column "
      + context.columnNumber, context, this);
  }
  try {
    final Date result = formatter.parse((String) value);
    return next.execute(result, context);
View Full Code Here

/**
* {@inheritDoc}
*/
@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); }
 
View Full Code Here

* @throws SuperCSVException
*             when the value is some value that cannot be translated into a boolean value
*/
@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); }
  Boolean result;
  final String sval = ((String) value).toLowerCase();
  if( isFalseValue(sval) ) {
    result = Boolean.FALSE;
View Full Code Here

* {@inheritDoc}
*/
@Override
public Object execute(final Object value, final CSVContext context) throws SuperCSVException {
  if( value == null ) {
    throw new NullInputException("Input cannot be null", context, this);
  }
  String result = value.toString().replaceAll(searchText, replaceText);
  return next.execute(result, context);
}
View Full Code Here

  return next.execute(result, context);
}

private void handleArguments(final String searchText, final String replaceText) throws IllegalArgumentException {
  if( searchText == null ) {
    throw new NullInputException("searchtext cannot be null", this);
  }
  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;
View Full Code Here

TOP

Related Classes of org.supercsv.exception.NullInputException

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.