pl.edu.agh.cast.importer.base.tokenizer
Class AbstractImportTokenizer

java.lang.Object
  extended by pl.edu.agh.cast.importer.base.tokenizer.AbstractImportTokenizer
All Implemented Interfaces:
IImportTokenizer
Direct Known Subclasses:
AckTokenizer, CsvTokenizer, FixedWidthTokenizer, XlsTokenizer

public abstract class AbstractImportTokenizer
extends Object
implements IImportTokenizer

Abstract import tokenizer class, which defines some basic utility methods for all tokenizers.

Author:
AGH CAST Team

Field Summary
protected  List<ITokenizerOption> options
          The tokenizer options.
 
Constructor Summary
AbstractImportTokenizer()
           
 
Method Summary
 boolean equals(Object obj)
          
protected  Charset getEncoding()
           
protected  String getOptionValue(String optionName)
           
 List<ITokenizerOption> getTokenizerOptions()
          Returns tokenizer options.
 int hashCode()
          
protected static int removeEmptyCellsFromRowEnd(RawDataRow row)
          Removes empty cells from raw data row end.
protected static String removeQualifier(String inString, Character qualifier)
          Removes qualifier from around the specified input string.
 void setEncoding(Charset encoding)
          Sets the input stream encoding.
 void setTokenizerOptions(List<ITokenizerOption> tokenizerOptions)
          Sets the tokenizer options.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface pl.edu.agh.cast.importer.base.tokenizer.IImportTokenizer
tokenize
 

Field Detail

options

protected List<ITokenizerOption> options
The tokenizer options.

Constructor Detail

AbstractImportTokenizer

public AbstractImportTokenizer()
Method Detail

setEncoding

public void setEncoding(Charset encoding)
Sets the input stream encoding.

Specified by:
setEncoding in interface IImportTokenizer
Parameters:
encoding - the encoding of data contained in the input stream
See Also:
IImportTokenizer.setEncoding(java.nio.charset.Charset)

getEncoding

protected Charset getEncoding()

setTokenizerOptions

public void setTokenizerOptions(List<ITokenizerOption> tokenizerOptions)
Sets the tokenizer options.

Specified by:
setTokenizerOptions in interface IImportTokenizer
Parameters:
tokenizerOptions - the options passed to data tokenizer
See Also:
IImportTokenizer.setTokenizerOptions(java.util.List)

getTokenizerOptions

public List<ITokenizerOption> getTokenizerOptions()
Returns tokenizer options.

Specified by:
getTokenizerOptions in interface IImportTokenizer
Returns:
tokenizer options.
See Also:
IImportTokenizer.getTokenizerOptions()

getOptionValue

protected String getOptionValue(String optionName)

removeQualifier

protected static String removeQualifier(String inString,
                                        Character qualifier)
Removes qualifier from around the specified input string.

Parameters:
inString - the string to remove quotes from
Returns:
the input string without surrounding quotes

removeEmptyCellsFromRowEnd

protected static int removeEmptyCellsFromRowEnd(RawDataRow row)
Removes empty cells from raw data row end.

Parameters:
row - the row to remove empty end cells from
Returns:
the number of cells removed

equals

public boolean equals(Object obj)

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

hashCode

public int hashCode()

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


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