BeanIO 2.0.4

org.beanio.internal.compiler
Class StreamCompiler

java.lang.Object
  extended by org.beanio.internal.compiler.StreamCompiler

public class StreamCompiler
extends Object

Compiles a mapping file read from an InputStream into a collection of Stream parsers.

Since:
2.0
Author:
Kevin Seim

Constructor Summary
StreamCompiler(ClassLoader classLoader)
          Constructs a new MappingFactory.
 
Method Summary
protected  ParserFactory createParserFactory(String format)
          Instantiates the factory implementation to create the stream definition.
protected  Collection<Stream> createStreamDefinitions(BeanIOConfig config)
          Creates stream definitions from a BeanIO stream mapping configuration.
 ConfigurationLoader getConfigurationLoader()
          Returns the mapping configuration loader.
protected  ConfigurationLoader getDefaultConfigurationLoader()
          Returns the default mapping configuration loader implementation.
 Collection<Stream> loadMapping(InputStream in, Properties properties)
          Loads a mapping file.
 void setConfigurationLoader(ConfigurationLoader configurationLoader)
          Sets the mapping configuration loader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamCompiler

public StreamCompiler(ClassLoader classLoader)
Constructs a new MappingFactory.

Parameters:
classLoader - the ClassLoader to use for resolving class names
Method Detail

loadMapping

public Collection<Stream> loadMapping(InputStream in,
                                      Properties properties)
                               throws IOException,
                                      BeanIOConfigurationException
Loads a mapping file.

Parameters:
in - the InputStream to load the mapping file from
properties - the Properties
Returns:
the Stream parsers configured in the loaded mapping file
Throws:
IOException - if an I/O error occurs reading the mapping file
BeanIOConfigurationException - if the mapping file is invalid

getDefaultConfigurationLoader

protected ConfigurationLoader getDefaultConfigurationLoader()
Returns the default mapping configuration loader implementation.

Returns:
the default mapping configuration

createStreamDefinitions

protected Collection<Stream> createStreamDefinitions(BeanIOConfig config)
                                              throws BeanIOConfigurationException
Creates stream definitions from a BeanIO stream mapping configuration.

Parameters:
config - the BeanIO stream mapping configuration
Returns:
the collection of stream definitions
Throws:
BeanIOConfigurationException - if a configuration setting is invalid

createParserFactory

protected ParserFactory createParserFactory(String format)
Instantiates the factory implementation to create the stream definition.

Parameters:
format - the stream format
Returns:
the stream definition factory

getConfigurationLoader

public ConfigurationLoader getConfigurationLoader()
Returns the mapping configuration loader.

Returns:
the mapping configuration loader

setConfigurationLoader

public void setConfigurationLoader(ConfigurationLoader configurationLoader)
Sets the mapping configuration loader.

Parameters:
configurationLoader - the mapping configuration loader

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim