public class StreamCompiler extends Object
InputStream into a collection of
Stream parsers.| Constructor and Description |
|---|
StreamCompiler(ClassLoader classLoader)
Constructs a new MappingFactory.
|
| Modifier and Type | Method and Description |
|---|---|
Stream |
build(StreamConfig config)
Creates a new Stream from its configuration.
|
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.
|
public StreamCompiler(ClassLoader classLoader)
classLoader - the ClassLoader to use for resolving class namespublic Stream build(StreamConfig config) throws BeanIOConfigurationException
config - the StreamConfigStream definitionBeanIOConfigurationExceptionpublic Collection<Stream> loadMapping(InputStream in, Properties properties) throws IOException, BeanIOConfigurationException
in - the InputStream to load the mapping file fromproperties - the PropertiesStream parsers configured in the loaded mapping fileIOException - if an I/O error occurs reading the mapping fileBeanIOConfigurationException - if the mapping file is invalidprotected ConfigurationLoader getDefaultConfigurationLoader()
protected Collection<Stream> createStreamDefinitions(BeanIOConfig config) throws BeanIOConfigurationException
config - the BeanIO stream mapping configurationBeanIOConfigurationException - if a configuration setting is invalidprotected ParserFactory createParserFactory(String format)
format - the stream formatpublic ConfigurationLoader getConfigurationLoader()
public void setConfigurationLoader(ConfigurationLoader configurationLoader)
configurationLoader - the mapping configuration loader