Class StreamCompiler


  • public class StreamCompiler
    extends java.lang.Object
    Compiles a mapping file read from an InputStream into a collection of Stream parsers.
    Since:
    2.0
    • Constructor Detail

      • StreamCompiler

        public StreamCompiler​(java.lang.ClassLoader classLoader)
        Constructs a new MappingFactory.
        Parameters:
        classLoader - the ClassLoader to use for resolving class names
    • Method Detail

      • loadMapping

        public java.util.Collection<Stream> loadMapping​(java.io.InputStream in,
                                                        java.util.Properties properties)
                                                 throws java.io.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:
        java.io.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 java.util.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​(java.lang.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