Class EMFJSONLoader<E extends org.eclipse.emf.ecore.EObject>

java.lang.Object
com.amalgamasimulation.emf.json.EMFJSONSaverAndLoaderFactory<E>
com.amalgamasimulation.emf.json.EMFJSONLoader<E>
All Implemented Interfaces:
EMFLoader<E>, EMFLoaderFactory<E>, EMFSaverAndLoaderFactory<E>, EMFSaverFactory<E>, ErrorsContainer

public class EMFJSONLoader<E extends org.eclipse.emf.ecore.EObject> extends EMFJSONSaverAndLoaderFactory<E> implements EMFLoader<E>
  • Field Details

    • resource

      protected org.eclipse.emf.ecore.resource.Resource resource
    • rootObject

      protected E extends org.eclipse.emf.ecore.EObject rootObject
    • filePath

      protected String filePath
  • Constructor Details

    • EMFJSONLoader

      protected EMFJSONLoader(String filePath, List<org.eclipse.emf.ecore.EPackage> ePackages)
  • Method Details

    • load

      public boolean load()
      Description copied from interface: EMFLoader
      Tries to load the file. Returns true if loading completed successfully, i.e. without errors. Note that in this case there still can be warnings.
      Specified by:
      load in interface EMFLoader<E extends org.eclipse.emf.ecore.EObject>
      Returns:
      true if loading completed successfully, false otherwise
    • load

      public boolean load(boolean readWorkbookProperties)
      Description copied from interface: EMFLoader
      Tries to load the file. Returns true if loading completed successfully, i.e. without errors. Note that in this case there still can be warnings.
      Specified by:
      load in interface EMFLoader<E extends org.eclipse.emf.ecore.EObject>
      Parameters:
      readWorkbookProperties - whether or not to read custom properties of the workbook. These properties define index of first data rows and columns. Reading these properties can slow down loading big data files
      Returns:
      true if loading completed successfully, false otherwise
    • getRootObject

      public E getRootObject()
      Description copied from interface: EMFLoader
      Returns the root object of the EMF data model if the file has been loaded and null otherwise.
      Specified by:
      getRootObject in interface EMFLoader<E extends org.eclipse.emf.ecore.EObject>
      Returns:
      root object of the EMF data model, or null
      See Also:
    • isLoaded

      public boolean isLoaded()
      Description copied from interface: EMFLoader
      Checks if the file was loaded successfully, i.e. without any errors. Returns false if the file has not yet been loaded.
      Specified by:
      isLoaded in interface EMFLoader<E extends org.eclipse.emf.ecore.EObject>
      Returns:
      true if the file was loaded without any errors, false otherwise