Package com._1c.g5.v8.dt.bsl.resource
Class BslContextDefResource
- java.lang.Object
-
- org.eclipse.emf.common.notify.impl.BasicNotifierImpl
-
- org.eclipse.emf.common.notify.impl.NotifierImpl
-
- org.eclipse.emf.ecore.resource.impl.ResourceImpl
-
- org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl
-
- com._1c.g5.v8.dt.bsl.resource.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
SpecialBinaryResourceImpl
forBslContextDef
. 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 ofContextDef
uri in bsl modelstatic 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
-
-
Constructor Summary
Constructors Constructor Description BslContextDefResource(BslResource resource)
ConstructorBslContextDefResource(org.eclipse.emf.common.util.URI uri)
Creates resource with concrete uri
-
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 nameprojectName
static File
getContextDefFileByUri(org.eclipse.emf.common.util.URI uri)
GetsFile
corresponding to theuri
static org.eclipse.emf.common.util.URI
getContextDefUri(org.eclipse.emf.common.util.URI bslResourceUri)
Creates resourceURI
by bsl resource uriorg.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 diskprotected OutputStream
getOutputStream()
Gets output stream for writing content of the resource to the diskprotected File
getResourceFile(org.eclipse.emf.common.util.URI uri)
Gets file by resource uri for saving or loading resource contentprotected 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 theuri
existvoid
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
-
-
-
-
Field Detail
-
EXT
public static final String EXT
Special extension of resource files- See Also:
- Constant Field Values
-
CONTEXT_DEF_FRAGMENT
public static final String CONTEXT_DEF_FRAGMENT
Fragment ofContextDef
uri in bsl model- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BslContextDefResource
public BslContextDefResource(BslResource resource)
Constructor- Parameters:
resource
- bsl resource containsModule
withContextDef
saving or loading to creating resource, can't benull
-
BslContextDefResource
public BslContextDefResource(org.eclipse.emf.common.util.URI uri)
Creates resource with concrete uri- Parameters:
uri
- uri of the resource, can't benull
-
-
Method Detail
-
getContextDefUri
public static org.eclipse.emf.common.util.URI getContextDefUri(org.eclipse.emf.common.util.URI bslResourceUri)
Creates resourceURI
by bsl resource uri- Parameters:
bslResourceUri
- bsl resource uri, can't benull
- Returns:
- resource
URI
by bsl resource uri, nevernull
-
getContextDefFileByUri
public static File getContextDefFileByUri(org.eclipse.emf.common.util.URI uri)
GetsFile
corresponding to theuri
- Parameters:
uri
- uri for getting file, can't benull
- Returns:
File
corresponding to theuri
nevernull
-
isContextDefFileExist
public static boolean isContextDefFileExist(org.eclipse.emf.common.util.URI uri)
Checks that file of resource corresponding to theuri
exist- Parameters:
uri
- uri of checking resource file, can't benull
- Returns:
true
if file of resource corresponding to theuri
exist,false
otherwise
-
deleteAllProjectResources
public static void deleteAllProjectResources(String projectName)
Deleted all resource files for project with nameprojectName
- Parameters:
projectName
- name of the project for deleting resources, can't benull
-
save
public void save(Map<?,?> options) throws IOException
- Specified by:
save
in interfaceorg.eclipse.emf.ecore.resource.Resource
- Overrides:
save
in classorg.eclipse.emf.ecore.resource.impl.ResourceImpl
- Throws:
IOException
-
load
public void load(Map<?,?> options) throws IOException
- Specified by:
load
in interfaceorg.eclipse.emf.ecore.resource.Resource
- Overrides:
load
in classorg.eclipse.emf.ecore.resource.impl.ResourceImpl
- Throws:
IOException
-
getEObject
public org.eclipse.emf.ecore.EObject getEObject(String uriFragment)
- Specified by:
getEObject
in interfaceorg.eclipse.emf.ecore.resource.Resource
- Overrides:
getEObject
in classorg.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 benull
- Returns:
- file by resource uri for saving or loading resource content, never
null
- Throws:
FileNotFoundException
- if project corresponding to theuri
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 classorg.eclipse.emf.ecore.resource.impl.ResourceImpl
-
getURIFragmentRootSegment
protected String getURIFragmentRootSegment(org.eclipse.emf.ecore.EObject eObject)
- Overrides:
getURIFragmentRootSegment
in classorg.eclipse.emf.ecore.resource.impl.ResourceImpl
-
-