pl.edu.agh.cast.data.importer.data
Class AbstractDataImporterBase
java.lang.Object
pl.edu.agh.cast.data.importer.data.AbstractDataImporterBase
- All Implemented Interfaces:
- IDataImporter
- Direct Known Subclasses:
- AbstractXlsDataImporter, AckDataImporter, CsvDataImporter, TxtDataImporter
public abstract class AbstractDataImporterBase
- extends Object
- implements IDataImporter
Abstract data importer class, which defines the basic validation for importers.
- Author:
- AGH CAST Team
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
importerUtil
protected ImporterUtil importerUtil
- Importer helper class.
AbstractDataImporterBase
protected AbstractDataImporterBase()
setImporterUtil
public void setImporterUtil(ImporterUtil importerUtil)
validate
public final boolean validate(InputStream dataIs,
Map<String,String> options)
- Validate if importer is good. This method tries not to change the state of dataIs parameter. If dataIs parameter is null, the
method returns false.
- Specified by:
validate
in interface IDataImporter
- Parameters:
dataIs
- The data input stream to be transformedoptions
- Options passed to data importer
- Returns:
true
is the importer is valid; false
otherwise- See Also:
IDataImporter.validate(java.io.InputStream, java.util.Map)
validateImporter
public boolean validateImporter(InputStream dataIs,
Map<String,String> options)
- Basic validation for importers. True result is returned when more than half of first rows has at least 2 columns.
- Parameters:
dataIs
- input stream with sample dataoptions
- importer options
- Returns:
true
is the importer is valid; false
otherwise
getOptions
public Map<String,String> getOptions()
- Description copied from interface:
IDataImporter
- Retrieves the importer options.
- Specified by:
getOptions
in interface IDataImporter
- Returns:
- importer options.
removeEmptyCellsFromRowEnd
protected static int removeEmptyCellsFromRowEnd(DataRow resultRow)
Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.