Class AbstractXmlFileReader

    • Constructor Detail

      • AbstractXmlFileReader

        public AbstractXmlFileReader()
    • Method Detail

      • read

        public XmlReaderResult read​(Document document,
                                    Path path,
                                    org.eclipse.emf.ecore.EClass eClass,
                                    org.eclipse.emf.ecore.EStructuralFeature feature,
                                    Version version)
        Description copied from interface: IXmlFileReader
        Read XML file to the XML reader result with the provided eClass content.
        Specified by:
        read in interface IXmlFileReader
        Parameters:
        document - the XML document parsed from file, cannot be null
        path - the file path with XML document, cannot be null
        eClass - the class to read object with, cannot be null
        feature - the context feature containing eClass or null if not needed
        version - the version of importing 1C:Enterprise XML files, cannot be null
        Returns:
        the XmlReaderResult as importing result with the provided eClass content, never null
      • getRootNode

        protected abstract IXmlNode getRootNode​(Document doc)
        Method to take core xml element for importing object
        Parameters:
        doc - the Document of xml file
        Returns:
        IXmlNode core xml element for importing object
      • read

        protected abstract XmlReaderResult read​(IXmlNode node,
                                                Version version,
                                                XmlFileReaderContext readerContext)
        Read xml node
        Parameters:
        node - the core xml element for importing object, cannot be null
        version - xml runtime version, cannot be null
        readerContext - extended file reader context, cannot be null
        Returns:
        the XmlReaderResult as importing result, never null
      • getXmlFileReaderContext

        protected XmlFileReaderContext getXmlFileReaderContext​(Path path,
                                                               org.eclipse.emf.ecore.EClass eClass,
                                                               org.eclipse.emf.ecore.EStructuralFeature feature)
        Parameters:
        path - the file path with XML document, cannot be null
        eClass - the class to read object with, cannot be null
        feature - the context feature containing eClass or null if not needed
        Returns:
        instance of XmlFileReaderContext, never null
      • getWrongAttributeValueMessage

        protected String getWrongAttributeValueMessage​(String value,
                                                       String path,
                                                       String attributeName)
        Generate error message about wrong attribute values in xml
        Parameters:
        value - the attribute value, can be null
        path - position of xml node in document, cannot be null
        attributeName - the name of attribute, cannot be null
        Returns:
        the error message, never null
      • getXmlElementRequiredMessage

        protected String getXmlElementRequiredMessage​(String path)
        Generate error message about required xml element
        Parameters:
        path - position of required xml node in document, cannot be null
        Returns:
        the error message, never null