Class ImportUtil


  • public class ImportUtil
    extends Object
    Import helper utilities
    • Constructor Detail

      • ImportUtil

        public ImportUtil()
    • Method Detail

      • getExternalObjectType

        public static org.eclipse.emf.ecore.EClass getExternalObjectType​(Path externalObjectPath)
                                                                  throws IOException,
                                                                         XMLStreamException
        Get external object type by path
        Parameters:
        externalObjectPath - path to external object "root" file, cannot be null
        Returns:
        type of external object or null if type cannot be recognized
        Throws:
        IOException - if an I/O error occurs
        XMLStreamException - if an xml steam processing error occurs
      • readTextFromXmlElement

        public static String readTextFromXmlElement​(Path xmlFilePath,
                                                    String... elementPath)
                                             throws IOException,
                                                    XMLStreamException
        Get text of element by path
        Parameters:
        xmlFilePath - path to xml file, cannot be null
        elementPath - the string names sequence from root xml element to target element with text, cannot be null
        Returns:
        xml element text from given path or null if xml element cannot be recognized
        Throws:
        IOException - if an I/O error occurs
        XMLStreamException - if an xml steam processing error occurs