Package org.beanio.internal.compiler
Interface ParserFactory
-
- All Known Implementing Classes:
CsvParserFactory,DelimitedParserFactory,FixedLengthParserFactory,FlatParserFactory,JsonParserFactory,ParserFactorySupport,XmlParserFactory
public interface ParserFactoryAParserFactoryis used to convert a stream configuration (i.e.StreamConfig) into a stream parser (i.e.Stream).A new parser factory is used to parse each stream configuration, thus implementations need not worry about thread safety.
All properties (e.g.
classLoader) are set beforecreateStream(StreamConfig)is invoked.- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StreamcreateStream(StreamConfig config)Creates a new stream parser from a given stream configuration.voidsetClassLoader(java.lang.ClassLoader classLoader)Sets theClassLoaderto use for resolving configured class names.voidsetTypeHandlerFactory(TypeHandlerFactory typeHandlerFactory)Sets the type handler factory to use for resolving type handlers.
-
-
-
Method Detail
-
setClassLoader
void setClassLoader(java.lang.ClassLoader classLoader)
Sets theClassLoaderto use for resolving configured class names.- Parameters:
classLoader- theClassLoader
-
setTypeHandlerFactory
void setTypeHandlerFactory(TypeHandlerFactory typeHandlerFactory)
Sets the type handler factory to use for resolving type handlers.- Parameters:
typeHandlerFactory- theTypeHandlerFactory
-
createStream
Stream createStream(StreamConfig config) throws BeanIOConfigurationException
Creates a new stream parser from a given stream configuration.- Parameters:
config- the stream configuration- Returns:
- the create
Stream - Throws:
BeanIOConfigurationException- if the configuration is invalid
-
-