BeanIO 2.0.4

org.beanio.internal.config.xml
Class XmlConfigurationLoader

java.lang.Object
  extended by org.beanio.internal.config.xml.XmlConfigurationLoader
All Implemented Interfaces:
ConfigurationLoader

public class XmlConfigurationLoader
extends Object
implements ConfigurationLoader

Loads BeanIO mapping files in XML format. This class is made thread safe by delegating most of the parsing logic to XmlMappingParser, for which a new instance is created for each input stream that requires parsing.

Since:
1.0
Author:
Kevin Seim

Constructor Summary
XmlConfigurationLoader(ClassLoader classLoader)
          Constructs a new XmlConfigurationLoader.
 
Method Summary
protected  XmlMappingParser createParser()
          Creates a XmlMappingParser for reading an mapping input stream.
protected  XmlMappingReader getReader()
          Returns the XmlMappingReader for reading XML mapping files into a document object model (DOM).
 Collection<BeanIOConfig> loadConfiguration(InputStream in, Properties properties)
          Loads a BeanIO configuration from an input stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlConfigurationLoader

public XmlConfigurationLoader(ClassLoader classLoader)
Constructs a new XmlConfigurationLoader.

Parameters:
classLoader - the ClassLoader for loading imported resources
Method Detail

loadConfiguration

public Collection<BeanIOConfig> loadConfiguration(InputStream in,
                                                  Properties properties)
                                           throws IOException,
                                                  BeanIOConfigurationException
Description copied from interface: ConfigurationLoader
Loads a BeanIO configuration from an input stream.

Specified by:
loadConfiguration in interface ConfigurationLoader
Parameters:
in - the input stream to read the configuration from
properties - the Properties for expansion in the mapping file
Returns:
a collection of loaded BeanIO configurations
Throws:
IOException - if an I/O error occurs
BeanIOConfigurationException - if the configuration is invalid or malformed

createParser

protected XmlMappingParser createParser()
Creates a XmlMappingParser for reading an mapping input stream.

Returns:
a new XML mapping parser

getReader

protected XmlMappingReader getReader()
Returns the XmlMappingReader for reading XML mapping files into a document object model (DOM).

Returns:
the XML mapping reader

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim