BeanIO 2.0.4

org.beanio.internal.compiler
Interface ParserFactory

All Known Implementing Classes:
CsvParserFactory, DelimitedParserFactory, FixedLengthParserFactory, FlatParserFactory, JsonParserFactory, ParserFactorySupport, XmlParserFactory

public interface ParserFactory

A ParserFactory is 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 before createStream(StreamConfig) is invoked.

Since:
2.0
Author:
Kevin Seim

Method Summary
 Stream createStream(StreamConfig config)
          Creates a new stream parser from a given stream configuration.
 void setClassLoader(ClassLoader classLoader)
          Sets the ClassLoader to use for resolving configured class names.
 void setTypeHandlerFactory(TypeHandlerFactory typeHandlerFactory)
          Sets the type handler factory to use for resolving type handlers.
 

Method Detail

setClassLoader

void setClassLoader(ClassLoader classLoader)
Sets the ClassLoader to use for resolving configured class names.

Parameters:
classLoader - the ClassLoader

setTypeHandlerFactory

void setTypeHandlerFactory(TypeHandlerFactory typeHandlerFactory)
Sets the type handler factory to use for resolving type handlers.

Parameters:
typeHandlerFactory - the TypeHandlerFactory

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

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim