Package org.beanio.internal.config.xml
Class XmlConfigurationLoader
- java.lang.Object
-
- org.beanio.internal.config.xml.XmlConfigurationLoader
-
- All Implemented Interfaces:
ConfigurationLoader
public class XmlConfigurationLoader extends java.lang.Object implements ConfigurationLoader
Loads BeanIO mapping files in XML format. This class is made thread safe by delegating most of the parsing logic toXmlMappingParser, for which a new instance is created for each input stream that requires parsing.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description XmlConfigurationLoader(java.lang.ClassLoader classLoader)Constructs a newXmlConfigurationLoader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected XmlMappingParsercreateParser()Creates aXmlMappingParserfor reading an mapping input stream.protected XmlMappingReadergetReader()Returns theXmlMappingReaderfor reading XML mapping files into a document object model (DOM).java.util.Collection<BeanIOConfig>loadConfiguration(java.io.InputStream in, java.util.Properties properties)Loads a BeanIO configuration from an input stream.
-
-
-
Method Detail
-
loadConfiguration
public java.util.Collection<BeanIOConfig> loadConfiguration(java.io.InputStream in, java.util.Properties properties) throws java.io.IOException, BeanIOConfigurationException
Description copied from interface:ConfigurationLoaderLoads a BeanIO configuration from an input stream.- Specified by:
loadConfigurationin interfaceConfigurationLoader- Parameters:
in- the input stream to read the configuration fromproperties- thePropertiesfor expansion in the mapping file- Returns:
- a collection of loaded BeanIO configurations
- Throws:
java.io.IOException- if an I/O error occursBeanIOConfigurationException- if the configuration is invalid or malformed
-
createParser
protected XmlMappingParser createParser()
Creates aXmlMappingParserfor reading an mapping input stream.- Returns:
- a new XML mapping parser
-
getReader
protected XmlMappingReader getReader()
Returns theXmlMappingReaderfor reading XML mapping files into a document object model (DOM).- Returns:
- the XML mapping reader
-
-