All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.supercsv.ext.cellprocessor.ExtCellProcessorAdaptor Maven / Gradle / Ivy

/*
 * ExtCellProcessorAdaptor.java
 * created in 2013/04/19
 *
 * (C) Copyright 2003-2013 GreenDay Project. All rights reserved.
 */
package org.supercsv.ext.cellprocessor;

import org.supercsv.cellprocessor.CellProcessorAdaptor;
import org.supercsv.cellprocessor.ift.CellProcessor;
import org.supercsv.exception.NullInputException;
import org.supercsv.util.CSVContext;


/**
 * CellProcessorAdaptor for SueprCSV2.x
 *
 * @since 01-00
 * @author T.TSUCHIE
 *
 */
public abstract class ExtCellProcessorAdaptor extends CellProcessorAdaptor {
    
    protected ExtCellProcessorAdaptor() {
        super();
    }
    
    protected ExtCellProcessorAdaptor(final CellProcessor next) {
        super(next);
    }
    
    /**
     * Checks that the input value is not null, throwing a NullInputException if it is. This method
     * should be called by all processors that need to ensure the input is not null.
     * 
     * @param value
     * @param context
     * @throws NullInputException
     *      if value is null
     */
    protected final void validateInputNotNull(final Object value, final CSVContext context) {
        if( value == null ) {
            throw new NullInputException("Input cannot be null on line " + context.lineNumber + " column "
                    + context.columnNumber, context, this);
        }
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy