net.sf.jmatchparser.util.csv.fieldreader
Class FieldSourceFactory

java.lang.Object
  extended by net.sf.jmatchparser.util.csv.fieldreader.FieldSourceFactory

public class FieldSourceFactory
extends Object

Class to create field sources from another CSV file.


Nested Class Summary
static class FieldSourceFactory.FieldSourceFactoryFields
          Fields used in the CSV file for defining field sources
 
Constructor Summary
FieldSourceFactory(AbstractCSVReader reader)
          Create a new field source factory that reads its field sources from the given CSV reader.
 
Method Summary
<K> Map<K,FieldSource>
createFieldSources(Collection<K> possibleFields)
          Create field sources from the CSV file.
<K> Map<K,FieldSource>
createFieldSources(K[] possibleFields)
          Create field sources from the CSV file.
 FieldReader<FieldSourceFactory.FieldSourceFactoryFields,Object> getReader()
          Get the FieldReader used to parse the CSV file, for customizing its field sources or other parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldSourceFactory

public FieldSourceFactory(AbstractCSVReader reader)
Create a new field source factory that reads its field sources from the given CSV reader.

Method Detail

getReader

public FieldReader<FieldSourceFactory.FieldSourceFactoryFields,Object> getReader()
Get the FieldReader used to parse the CSV file, for customizing its field sources or other parameters.


createFieldSources

public <K> Map<K,FieldSource> createFieldSources(K[] possibleFields)
                                      throws FieldReaderException,
                                             IOException
Create field sources from the CSV file.

Type Parameters:
K - Type of the fields used
Parameters:
possibleFields - Array of all possible fields, used to convert to string via Object.toString() and compare
Throws:
FieldReaderException
IOException

createFieldSources

public <K> Map<K,FieldSource> createFieldSources(Collection<K> possibleFields)
                                      throws FieldReaderException,
                                             IOException
Create field sources from the CSV file.

Type Parameters:
K - Type of the fields used
Parameters:
possibleFields - All possible fields, used to convert to string via Object.toString() and compare
Throws:
FieldReaderException
IOException


Copyright © 2011. All Rights Reserved.