org.onebusaway.csv_entities
Class CsvEntityReader

java.lang.Object
  extended by org.onebusaway.csv_entities.CsvEntityReader

public class CsvEntityReader
extends Object


Field Summary
static String KEY_CONTEXT
           
 
Constructor Summary
CsvEntityReader()
           
 
Method Summary
 void addEntityHandler(EntityHandler handler)
           
 void close()
           
 CsvEntityContext getContext()
           
 EntitySchemaFactory getEntitySchemaFactory()
           
 CsvInputSource getInputSource()
           
 void injectEntity(Object entity)
          Sometimes it may be necessary to inject an instantiated entity directly instead of loading it from a CSV source.
 InputStream openInputStreamForEntityClass(CsvInputSource source, Class<?> entityClass)
           
 void readEntities(Class<?> entityClass)
           
 void readEntities(Class<?> entityClass, CsvInputSource source)
           
 void readEntities(Class<?> entityClass, InputStream is)
           
 void readEntities(Class<?> entityClass, Reader reader)
           
 void setEntitySchemaFactory(EntitySchemaFactory entitySchemaFactory)
           
 void setInputLocation(File path)
           
 void setInputSource(CsvInputSource source)
           
 void setInternStrings(boolean internStrings)
           
 void setTokenizerStrategy(TokenizerStrategy tokenizerStrategy)
           
 void setTrimValues(boolean trimValues)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_CONTEXT

public static final String KEY_CONTEXT
Constructor Detail

CsvEntityReader

public CsvEntityReader()
Method Detail

getEntitySchemaFactory

public EntitySchemaFactory getEntitySchemaFactory()
Returns:
the EntitySchemaFactory that will be used for introspection of bean classes

setEntitySchemaFactory

public void setEntitySchemaFactory(EntitySchemaFactory entitySchemaFactory)

getInputSource

public CsvInputSource getInputSource()

setInputSource

public void setInputSource(CsvInputSource source)

setInputLocation

public void setInputLocation(File path)
                      throws IOException
Throws:
IOException

setTokenizerStrategy

public void setTokenizerStrategy(TokenizerStrategy tokenizerStrategy)

setTrimValues

public void setTrimValues(boolean trimValues)

addEntityHandler

public void addEntityHandler(EntityHandler handler)

getContext

public CsvEntityContext getContext()

setInternStrings

public void setInternStrings(boolean internStrings)

readEntities

public void readEntities(Class<?> entityClass)
                  throws IOException
Throws:
IOException

readEntities

public void readEntities(Class<?> entityClass,
                         CsvInputSource source)
                  throws IOException
Throws:
IOException

readEntities

public void readEntities(Class<?> entityClass,
                         InputStream is)
                  throws IOException,
                         CsvEntityIOException
Throws:
IOException
CsvEntityIOException

readEntities

public void readEntities(Class<?> entityClass,
                         Reader reader)
                  throws IOException,
                         CsvEntityIOException
Throws:
IOException
CsvEntityIOException

injectEntity

public void injectEntity(Object entity)
Sometimes it may be necessary to inject an instantiated entity directly instead of loading it from a CSV source. This method allows you to add a new entity, with all handlers called for that entity as if it had just been read from a source.

Parameters:
entity - the entity to be injected

openInputStreamForEntityClass

public InputStream openInputStreamForEntityClass(CsvInputSource source,
                                                 Class<?> entityClass)
                                          throws IOException
Throws:
IOException

close

public void close()
           throws IOException
Throws:
IOException


Copyright © 2012 OneBusAway. All Rights Reserved.