Class IVMLFileWriter


  • public class IVMLFileWriter
    extends java.lang.Object
    Extended IVMLWriter, which writes Projects and their imported Projects to a given location.
    Author:
    El-Sharkawy
    • Constructor Summary

      Constructors 
      Constructor Description
      IVMLFileWriter​(java.io.File folder)
      sole constructor for this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void forceComponundTypes​(boolean forceCompoundTypes)
      Forces the output of compound types and bypasses the automatic detection.
      void save​(Project mainProject)
      Saves the given project and all of its imports.
      void setFormatInitializer​(boolean formatInitializer)
      Defines whether initializers shall be formatted.
      private void write​(Project project)
      Recursive method to save all rpoejcts and their imports.
      • Methods inherited from class java.lang.Object

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

      • done

        private java.util.Set<Project> done
      • folder

        private final java.io.File folder
      • formatInitializer

        private boolean formatInitializer
      • forceCompoundTypes

        private boolean forceCompoundTypes
    • Constructor Detail

      • IVMLFileWriter

        public IVMLFileWriter​(java.io.File folder)
                       throws java.io.IOException
        sole constructor for this class.
        Parameters:
        folder - The folder where all projects shall be saved to.
        Throws:
        java.io.IOException - If the given specified folder is not a folder or does not exist.
    • Method Detail

      • setFormatInitializer

        public void setFormatInitializer​(boolean formatInitializer)
        Defines whether initializers shall be formatted.
        Parameters:
        formatInitializer - true if initializers shall be formatted, false else
      • forceComponundTypes

        public void forceComponundTypes​(boolean forceCompoundTypes)
        Forces the output of compound types and bypasses the automatic detection.
        Parameters:
        forceCompoundTypes - if true, compound types are always emitted at creation, false else
      • save

        public void save​(Project mainProject)
                  throws java.io.IOException
        Saves the given project and all of its imports.
        Parameters:
        mainProject - The starting project to save.
        Throws:
        java.io.IOException - If an IO error occurs during saving one of the projects.
      • write

        private void write​(Project project)
                    throws java.io.IOException
        Recursive method to save all rpoejcts and their imports.
        Parameters:
        project - The current project so save
        Throws:
        java.io.IOException - If an IO error occurs during saving one of the projects.