Class 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 to XmlMappingParser, for which a new instance is created for each input stream that requires parsing.
    Since:
    1.0
    • Constructor Detail

      • XmlConfigurationLoader

        public XmlConfigurationLoader​(java.lang.ClassLoader classLoader)
        Constructs a new XmlConfigurationLoader.
        Parameters:
        classLoader - the ClassLoader for loading imported resources
    • 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: 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:
        java.io.IOException - if an I/O error occurs
        BeanIOConfigurationException - if the configuration is invalid or malformed
      • getReader

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