Class XdtoToXsdSerializer


  • public class XdtoToXsdSerializer
    extends AbstractXdtoSerializer
    Special class for import/export XDTO Package content to the xsd scheme
    • Constructor Detail

      • XdtoToXsdSerializer

        public XdtoToXsdSerializer()
        Constructs a new instance.
    • Method Detail

      • exportToXsd

        public void exportToXsd​(XdtoResource resource,
                                OutputStream outputStream)
                         throws IOException
        Exports 1st resource element to the xsd format
        Parameters:
        resource - XdtoResource for exporting, can't be null and should have one root element
        outputStream - stream for writing xsd format, can't be null
        Throws:
        IOException - if I/O or xml exception were occurred
      • exportToXsd

        public void exportToXsd​(Package pack,
                                OutputStream outputStream)
                         throws IOException
        Exports package to the xsd format.
        Parameters:
        pack - Package for exporting, can't be null
        outputStream - stream for writing xsd format, can't be null
        Throws:
        IOException - if I/O or xml exception is occurred
      • exportToXsd

        public void exportToXsd​(Package pack,
                                Path path)
                         throws IOException
        Exports package to the xsd format.
        Parameters:
        pack - Package for exporting, can't be null
        path - Path to the file for writing xsd format, can't be null
        Throws:
        IOException - if I/O or xml exception is occurred
      • deserialize

        public Package deserialize​(XMLStreamReader reader,
                                   org.eclipse.emf.ecore.EObject container,
                                   org.eclipse.emf.ecore.EStructuralFeature featureToSet)
                            throws XMLStreamException
        Convert xsd scheme to Xdto object Package
        Parameters:
        reader - actual XMLStreamReader for reading xml structure text, can't be null
        container - object for setting Package, can't be null
        featureToSet - EStructuralFeature for setting Package, can't be null
        Returns:
        read Package, never null
        Throws:
        XMLStreamException - if invalid xml structure was found