org.onebusaway.csv_entities
Class CsvEntityReader
java.lang.Object
org.onebusaway.csv_entities.CsvEntityReader
public class CsvEntityReader
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KEY_CONTEXT
public static final String KEY_CONTEXT
CsvEntityReader
public CsvEntityReader()
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.