org.beanio.spring
Class BeanIOStreamFactory
java.lang.Object
org.beanio.spring.BeanIOStreamFactory
- All Implemented Interfaces:
- FactoryBean
public class BeanIOStreamFactory
- extends Object
- implements FactoryBean
A Spring factory bean for creating shared StreamFactory
instances for
BeanIO item readers and writers. Using a shared StreamFactory can improve
performance by preventing mapping files from being loaded more than once when
multiple item readers and writers are repeatedly invoked or share the same mapping
configuration.
- Since:
- 1.2
- Author:
- Kevin Seim
- See Also:
StreamFactory
,
BeanIOFlatFileItemReader
,
BeanIOFlatFileItemWriter
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BeanIOStreamFactory
public BeanIOStreamFactory()
getObject
public StreamFactory getObject()
throws Exception
- Specified by:
getObject
in interface FactoryBean
- Throws:
Exception
createStreamFactory
protected StreamFactory createStreamFactory()
throws IOException,
BeanIOConfigurationException
- Creates a new
StreamFactory
and loads configured stream mapping resources.
- Returns:
- the new StreamFactory
- Throws:
BeanIOConfigurationException
- if a stream mapping resource does not exist
or is invalid
IOException
- if an I/O error occurs
getObjectType
public Class<?> getObjectType()
- Specified by:
getObjectType
in interface FactoryBean
isSingleton
public boolean isSingleton()
- Specified by:
isSingleton
in interface FactoryBean
setStreamMappings
public void setStreamMappings(List<Resource> streamMappings)
- Sets the list of mapping files to load into this stream factory.
- Parameters:
streamMappings
- the list of mapping files
Copyright © 2010-2013 Kevin Seim