pl.edu.agh.cast.importer.base.parser
Class ImportParser

java.lang.Object
  extended by pl.edu.agh.cast.importer.base.parser.ImportParser
All Implemented Interfaces:
IImportParser

public class ImportParser
extends Object
implements IImportParser

Simple universal parser implementation.

Author:
AGH CAST Team

Constructor Summary
ImportParser(List<IAnalyzer> importAnalyzers)
          The default constructor.
 
Method Summary
 void changeRowValueAfterParsing(TabularData parsedData, ErrorsLog errorsLog, DataRow row, int index, String value)
          Changes token value in input row.
 ImportParser createCopy()
          Create parser copy which contains copies of all analyzers.
 boolean equals(Object obj)
          
 List<IAnalyzer> getAnalyzers()
           
 ErrorsLog getParseErrorsLog()
          Retrieves the parsing errors log.
 int hashCode()
          
 boolean isComplete()
          Checks if the parser has configured properly its analyzers.
 List<TabularData> parse(List<RawTabularData> rawTabularDatas, org.eclipse.core.runtime.IProgressMonitor monitor)
          Parse given unanalyzed tabular data.
 void setAnalyzers(List<IAnalyzer> analyzers)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImportParser

public ImportParser(List<IAnalyzer> importAnalyzers)
The default constructor.

Parameters:
importAnalyzers - the import analyzers
Method Detail

parse

public List<TabularData> parse(List<RawTabularData> rawTabularDatas,
                               org.eclipse.core.runtime.IProgressMonitor monitor)
Parse given unanalyzed tabular data.

Specified by:
parse in interface IImportParser
Parameters:
rawTabularDatas - the raw tabular data to parse
monitor - the progress monitor for the parse operation
Returns:
the list of parsed tabular data objects
See Also:
pl.edu.agh.cast.importer.base.parser.IImportParser#parse(java.util.List)

changeRowValueAfterParsing

public void changeRowValueAfterParsing(TabularData parsedData,
                                       ErrorsLog errorsLog,
                                       DataRow row,
                                       int index,
                                       String value)
Changes token value in input row. If needed errrorsLog is being modified.

Parameters:
row - input row
index - token index
value - token new value

getParseErrorsLog

public ErrorsLog getParseErrorsLog()
Retrieves the parsing errors log.

Specified by:
getParseErrorsLog in interface IImportParser
Returns:
errors log
See Also:
IImportParser.getParseErrorsLog()

isComplete

public boolean isComplete()
Checks if the parser has configured properly its analyzers.

Specified by:
isComplete in interface IImportParser
Returns:
true if all analyzers are configured
See Also:
IImportParser.isComplete()

createCopy

public ImportParser createCopy()
Create parser copy which contains copies of all analyzers. Note, that nor raw data, nor error logs are not copied.

Specified by:
createCopy in interface IImportParser
Returns:
parser copy
See Also:
IImportParser.createCopy()

setAnalyzers

public void setAnalyzers(List<IAnalyzer> analyzers)

getAnalyzers

public List<IAnalyzer> getAnalyzers()

equals

public boolean equals(Object obj)

Overrides:
equals in class Object
See Also:
java.lang.Object#equals()

hashCode

public int hashCode()

Overrides:
hashCode in class Object
See Also:
Object.hashCode()


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.