Class XmlMappingReader


  • public class XmlMappingReader
    extends java.lang.Object
    Reads a BeanIO XML mapping file into an XML document object model (DOM) and validates the XML using the BeanIO mapping schema.

    This class can safely parse multiple input streams concurrently.

    Since:
    1.2.1
    • Constructor Summary

      Constructors 
      Constructor Description
      XmlMappingReader()
      Constructs a new XmlMappingReader.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected javax.xml.parsers.DocumentBuilderFactory createDocumentBuilderFactory()
      Creates an XML document builder factory.
      protected org.xml.sax.EntityResolver createEntityResolver()
      Returns the XML entity resolver for loading the BeanIO schema definition or other reference entities.
      org.w3c.dom.Document loadDocument​(java.io.InputStream in)
      Parses an XML BeanIO mapping file into a document object model (DOM).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XmlMappingReader

        public XmlMappingReader()
        Constructs a new XmlMappingReader.
    • Method Detail

      • loadDocument

        public org.w3c.dom.Document loadDocument​(java.io.InputStream in)
                                          throws java.io.IOException,
                                                 BeanIOConfigurationException
        Parses an XML BeanIO mapping file into a document object model (DOM).
        Parameters:
        in - the input stream to read
        Returns:
        the resulting DOM
        Throws:
        java.io.IOException - if an I/O error occurs
        BeanIOConfigurationException - if the XML mapping file is malformed or invalid
      • createDocumentBuilderFactory

        protected javax.xml.parsers.DocumentBuilderFactory createDocumentBuilderFactory()
        Creates an XML document builder factory.
        Returns:
        the new DocumentBuilderFactory
      • createEntityResolver

        protected org.xml.sax.EntityResolver createEntityResolver()
        Returns the XML entity resolver for loading the BeanIO schema definition or other reference entities.
        Returns:
        XML entity resolver