Class BslContextDefResource

  • All Implemented Interfaces:
    org.eclipse.emf.common.notify.Notifier, org.eclipse.emf.ecore.resource.Resource, org.eclipse.emf.ecore.resource.Resource.Internal

    public class BslContextDefResource
    extends org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl
    Special BinaryResourceImpl for BslContextDef. This resource saves and loads from special place. File hierarchy of saving resource is defined by hierarchy of bsl files, but they contains in ".metadata/plugins/com._1c.g5.v8.dt.bsl"
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl

        org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.BinaryIO, org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.DataConverter<T extends Object>, org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectInputStream, org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectOutputStream
      • Nested classes/interfaces inherited from class org.eclipse.emf.ecore.resource.impl.ResourceImpl

        org.eclipse.emf.ecore.resource.impl.ResourceImpl.ContentsEList<E extends Object & org.eclipse.emf.ecore.EObject>, org.eclipse.emf.ecore.resource.impl.ResourceImpl.ModificationTrackingAdapter
      • Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl

        org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList<E extends Object & org.eclipse.emf.common.notify.Adapter>, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterList, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EScannableAdapterList
      • Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.resource.Resource

        org.eclipse.emf.ecore.resource.Resource.Diagnostic, org.eclipse.emf.ecore.resource.Resource.Factory, org.eclipse.emf.ecore.resource.Resource.Internal, org.eclipse.emf.ecore.resource.Resource.IOWrappedException
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String CONTEXT_DEF_FRAGMENT
      Fragment of ContextDef uri in bsl model
      static String EXT
      Special extension of resource files
      • Fields inherited from class org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl

        DEFAULT_BUFFER_CAPACITY, OPTION_BUFFER_CAPACITY, OPTION_EAGER_PROXY_RESOLUTION, OPTION_INTERNAL_BUFFER_CAPACITY, OPTION_STYLE_BINARY_DATE, OPTION_STYLE_BINARY_ENUMERATOR, OPTION_STYLE_BINARY_FLOATING_POINT, OPTION_STYLE_DATA_CONVERTER, OPTION_STYLE_PROXY_ATTRIBUTES, OPTION_VERSION
      • Fields inherited from class org.eclipse.emf.ecore.resource.impl.ResourceImpl

        contents, defaultDeleteOptions, defaultLoadOptions, defaultSaveOptions, errors, intrinsicIDToEObjectMap, isLoaded, isLoading, isModified, modificationTrackingAdapter, resourceSet, timeStamp, unloadingContents, uri, warnings
      • Fields inherited from class org.eclipse.emf.common.notify.impl.NotifierImpl

        eAdapters, EDELIVER, eFlags, ELAST_NOTIFIER_FLAG
      • Fields inherited from interface org.eclipse.emf.ecore.resource.Resource

        OPTION_CIPHER, OPTION_LINE_DELIMITER, OPTION_LINE_DELIMITER_UNSPECIFIED, OPTION_SAVE_ONLY_IF_CHANGED, OPTION_SAVE_ONLY_IF_CHANGED_FILE_BUFFER, OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER, OPTION_ZIP, RESOURCE__CONTENTS, RESOURCE__ERRORS, RESOURCE__IS_LOADED, RESOURCE__IS_MODIFIED, RESOURCE__IS_TRACKING_MODIFICATION, RESOURCE__RESOURCE_SET, RESOURCE__TIME_STAMP, RESOURCE__URI, RESOURCE__WARNINGS
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void deleteAllProjectResources​(String projectName)
      Deleted all resource files for project with name projectName
      static File getContextDefFileByUri​(org.eclipse.emf.common.util.URI uri)
      Gets File corresponding to the uri
      static org.eclipse.emf.common.util.URI getContextDefUri​(org.eclipse.emf.common.util.URI bslResourceUri)
      Creates resource URI by bsl resource uri
      org.eclipse.emf.ecore.EObject getEObject​(String uriFragment)  
      protected org.eclipse.emf.ecore.EObject getEObjectForURIFragmentRootSegment​(String uriFragmentRootSegment)  
      protected InputStream getInputStream()
      Gets input stream for reading content of the resource from the disk
      protected OutputStream getOutputStream()
      Gets output stream for writing content of the resource to the disk
      protected File getResourceFile​(org.eclipse.emf.common.util.URI uri)
      Gets file by resource uri for saving or loading resource content
      protected String getURIFragmentRootSegment​(org.eclipse.emf.ecore.EObject eObject)  
      static boolean isContextDefFileExist​(org.eclipse.emf.common.util.URI uri)
      Checks that file of resource corresponding to the uri exist
      void load​(Map<?,​?> options)  
      void save​(Map<?,​?> options)  
      • Methods inherited from class org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl

        createEObjectInputStream, createEObjectOutputStream, doLoad, doSave, getBufferCapacity, getInternalBufferCapacity
      • Methods inherited from class org.eclipse.emf.ecore.resource.impl.ResourceImpl

        addModificationTrackingAdapters, attached, attachedHelper, basicSetResourceSet, createModificationTrackingAdapter, delete, detached, detachedHelper, doUnload, getAllContents, getAllProperContents, getAllProperContents, getContents, getDefaultURIConverter, getEObject, getEObjectByID, getErrors, getIDForEObject, getIntrinsicIDToEObjectMap, getResourceSet, getTimeStamp, getUnloadingContents, getURI, getURIConverter, getURIFragment, getWarnings, handleLoadResponse, handleSaveResponse, isAttachedDetachedHelperRequired, isContentZipEntry, isLoaded, isLoading, isModified, isTrackingModification, load, mergeMaps, newContentZipEntry, removeModificationTrackingAdapters, save, saveOnlyIfChangedWithFileBuffer, saveOnlyIfChangedWithMemoryBuffer, setIntrinsicIDToEObjectMap, setLoaded, setModified, setTimeStamp, setTrackingModification, setURI, supportIDRelativeURIFragmentPaths, toKeyString, toString, unload, unloaded, useZip
      • Methods inherited from class org.eclipse.emf.common.notify.impl.NotifierImpl

        eAdapters, eBasicAdapters, eDeliver, eSetDeliver
      • Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl

        eBasicAdapterArray, eBasicHasAdapters, eNotificationRequired, eNotify
      • Methods inherited from interface org.eclipse.emf.common.notify.Notifier

        eAdapters, eDeliver, eNotify, eSetDeliver
    • Constructor Detail

      • BslContextDefResource

        public BslContextDefResource​(BslResource resource)
        Constructor
        Parameters:
        resource - bsl resource contains Module with ContextDef saving or loading to creating resource, can't be null
      • BslContextDefResource

        public BslContextDefResource​(org.eclipse.emf.common.util.URI uri)
        Creates resource with concrete uri
        Parameters:
        uri - uri of the resource, can't be null
    • Method Detail

      • getContextDefUri

        public static org.eclipse.emf.common.util.URI getContextDefUri​(org.eclipse.emf.common.util.URI bslResourceUri)
        Creates resource URI by bsl resource uri
        Parameters:
        bslResourceUri - bsl resource uri, can't be null
        Returns:
        resource URI by bsl resource uri, never null
      • getContextDefFileByUri

        public static File getContextDefFileByUri​(org.eclipse.emf.common.util.URI uri)
        Gets File corresponding to the uri
        Parameters:
        uri - uri for getting file, can't be null
        Returns:
        File corresponding to the uri never null
      • isContextDefFileExist

        public static boolean isContextDefFileExist​(org.eclipse.emf.common.util.URI uri)
        Checks that file of resource corresponding to the uri exist
        Parameters:
        uri - uri of checking resource file, can't be null
        Returns:
        true if file of resource corresponding to the uri exist, false otherwise
      • deleteAllProjectResources

        public static void deleteAllProjectResources​(String projectName)
        Deleted all resource files for project with name projectName
        Parameters:
        projectName - name of the project for deleting resources, can't be null
      • save

        public void save​(Map<?,​?> options)
                  throws IOException
        Specified by:
        save in interface org.eclipse.emf.ecore.resource.Resource
        Overrides:
        save in class org.eclipse.emf.ecore.resource.impl.ResourceImpl
        Throws:
        IOException
      • load

        public void load​(Map<?,​?> options)
                  throws IOException
        Specified by:
        load in interface org.eclipse.emf.ecore.resource.Resource
        Overrides:
        load in class org.eclipse.emf.ecore.resource.impl.ResourceImpl
        Throws:
        IOException
      • getEObject

        public org.eclipse.emf.ecore.EObject getEObject​(String uriFragment)
        Specified by:
        getEObject in interface org.eclipse.emf.ecore.resource.Resource
        Overrides:
        getEObject in class org.eclipse.emf.ecore.resource.impl.ResourceImpl
      • getOutputStream

        protected OutputStream getOutputStream()
        Gets output stream for writing content of the resource to the disk
        Returns:
        output stream for writing content of the resource to the disk, never null
      • getResourceFile

        protected File getResourceFile​(org.eclipse.emf.common.util.URI uri)
                                throws FileNotFoundException
        Gets file by resource uri for saving or loading resource content
        Parameters:
        uri - of the resource, can't be null
        Returns:
        file by resource uri for saving or loading resource content, never null
        Throws:
        FileNotFoundException - if project corresponding to the uri wasn't found
      • getInputStream

        protected InputStream getInputStream()
        Gets input stream for reading content of the resource from the disk
        Returns:
        input stream for reading content of the resource from the disk, never null
      • getEObjectForURIFragmentRootSegment

        protected org.eclipse.emf.ecore.EObject getEObjectForURIFragmentRootSegment​(String uriFragmentRootSegment)
        Overrides:
        getEObjectForURIFragmentRootSegment in class org.eclipse.emf.ecore.resource.impl.ResourceImpl
      • getURIFragmentRootSegment

        protected String getURIFragmentRootSegment​(org.eclipse.emf.ecore.EObject eObject)
        Overrides:
        getURIFragmentRootSegment in class org.eclipse.emf.ecore.resource.impl.ResourceImpl