Package com._1c.g5.v8.dt.core.provider
Class BasicBmObjectExporter
- java.lang.Object
-
- com._1c.g5.v8.dt.core.provider.BasicBmObjectExporter
-
- All Implemented Interfaces:
IBmObjectExporter
- Direct Known Subclasses:
CaiBmExporter
,CmiExporter
,GraphicalSchemeBmExporter
,HpwaExporter
,ScheduleExporter
public abstract class BasicBmObjectExporter extends Object implements IBmObjectExporter
BasicIBmObjectExporter
implementation for serializing BigModel objects.How objects would be merged to target resource is defined by
BasicBmObjectExporter.IMergeStrategy
. Resource name is defined byIProjectFileSystemSupport
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
BasicBmObjectExporter.IMergeStrategy
Merge strategy.
-
Constructor Summary
Constructors Constructor Description BasicBmObjectExporter(ISymbolicNameService symbolicNameService, org.eclipse.emf.ecore.resource.Resource.Factory resourceFactory, BasicBmObjectExporter.IMergeStrategy mergeStrategy, IResourceContentExporterExtensionManager resourceContentExporterExtensionManager)
Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected org.eclipse.emf.ecore.EObject
cloneObject(IBmObject targetBmObject, IBmTransaction transaction)
Clones object to be exported.protected boolean
deleteFile(org.eclipse.core.resources.IProject project, String fileName)
Deletes file from the project.protected void
doExport(IBmModel model, IBmObject bmObject, IBmObject clone, org.eclipse.core.resources.IFile file, Collection<org.eclipse.core.resources.IFile> exportedExtraFiles)
void
export(IBmModel model, IBmObject bmObject, org.eclipse.core.resources.IFile file, Collection<org.eclipse.core.resources.IFile> exportedExtraFiles)
Exports bmObjectprotected IFormatter
getFormatter()
void
removeExtraObjects(IBmObject bmObject, String oldFqn)
Removes extra objects prior exporting of a new (or only) external representation of the object.protected void
saveExtraObjects(IBmModel model, org.eclipse.core.resources.IFile file, IBmObject bmObject, Collection<org.eclipse.core.resources.IFile> exportedExtraFiles)
Saves extra information attached tobmObject
.protected void
saveExtraObjects(org.eclipse.core.resources.IFile file, IBmObject bmObject, Collection<org.eclipse.core.resources.IFile> exportedExtraFiles)
Deprecated.the method is preserved for backward compatibility only.protected void
waitDerivedDataComputation(IBmObject bmObject)
Waits DS calculation before save.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com._1c.g5.v8.dt.core.provider.IBmObjectExporter
canExport
-
-
-
-
Constructor Detail
-
BasicBmObjectExporter
public BasicBmObjectExporter(ISymbolicNameService symbolicNameService, org.eclipse.emf.ecore.resource.Resource.Factory resourceFactory, BasicBmObjectExporter.IMergeStrategy mergeStrategy, IResourceContentExporterExtensionManager resourceContentExporterExtensionManager)
Constructs a new instance.- Parameters:
symbolicNameService
- the symbolic name service to use, may not benull
.resourceFactory
- the resource factory to use, may not benull
.mergeStrategy
- the merge strategy to use, may not benull
.resourceContentExporterExtensionManager
- the exporter extension manager to use, may not benull
.
-
-
Method Detail
-
export
public final void export(IBmModel model, IBmObject bmObject, org.eclipse.core.resources.IFile file, Collection<org.eclipse.core.resources.IFile> exportedExtraFiles) throws org.eclipse.core.runtime.CoreException
Description copied from interface:IBmObjectExporter
Exports bmObject- Specified by:
export
in interfaceIBmObjectExporter
- Parameters:
model
- the model the exported object belongs to (notnull
)bmObject
- the object form Big Model (notnull
)file
- the output file (notnull
)exportedExtraFiles
- the collection where all the exported extra files must be placed (notnull
).- Throws:
org.eclipse.core.runtime.CoreException
-
removeExtraObjects
public void removeExtraObjects(IBmObject bmObject, String oldFqn)
Description copied from interface:IBmObjectExporter
Removes extra objects prior exporting of a new (or only) external representation of the object.- Specified by:
removeExtraObjects
in interfaceIBmObjectExporter
- Parameters:
bmObject
- the object form Big Model (notnull
)oldFqn
- Old object FQN, if any. May benull
-
cloneObject
protected org.eclipse.emf.ecore.EObject cloneObject(IBmObject targetBmObject, IBmTransaction transaction)
Clones object to be exported. The given object isn't attached to the transaction.- Parameters:
targetBmObject
-transaction
-
-
waitDerivedDataComputation
protected void waitDerivedDataComputation(IBmObject bmObject)
Waits DS calculation before save. Implementing class should define the logic of waiting by itself.- Parameters:
bmObject
- The context object.
-
saveExtraObjects
protected void saveExtraObjects(IBmModel model, org.eclipse.core.resources.IFile file, IBmObject bmObject, Collection<org.eclipse.core.resources.IFile> exportedExtraFiles)
Saves extra information attached tobmObject
.- Parameters:
model
- the model the exported object belongs to (notnull
)file
- file name under whichbmObject
is stored; this name is taken as some basis for file name(s) of the attached object(s)bmObject
- a topIBmObject
that contains extra objects that are to be saved by this method.exportedExtraFiles
- the collection where all the exported extra files must be placed (notnull
).
-
saveExtraObjects
@Deprecated protected void saveExtraObjects(org.eclipse.core.resources.IFile file, IBmObject bmObject, Collection<org.eclipse.core.resources.IFile> exportedExtraFiles)
Deprecated.the method is preserved for backward compatibility only. Use four-argument counterpart.Saves extra information attached tobmObject
.- Parameters:
file
- file name under whichbmObject
is stored; this name is taken as some basis for file name(s) of the attached object(s)bmObject
- a topIBmObject
that contains extra objects that are to be saved by this method.exportedExtraFiles
- the collection where all the exported extra files must be placed (notnull
).
-
deleteFile
protected boolean deleteFile(org.eclipse.core.resources.IProject project, String fileName) throws org.eclipse.core.runtime.CoreException
Deletes file from the project. Please note that this operation should be called from the resource operation.- Parameters:
project
- The project to delete the file from.fileName
- The file name to delete.- Returns:
- True in case if the file was removed; false otherwise.
- Throws:
org.eclipse.core.runtime.CoreException
- In case of removal error.
-
doExport
protected void doExport(IBmModel model, IBmObject bmObject, IBmObject clone, org.eclipse.core.resources.IFile file, Collection<org.eclipse.core.resources.IFile> exportedExtraFiles) throws org.eclipse.core.runtime.CoreException
- Throws:
org.eclipse.core.runtime.CoreException
-
getFormatter
protected IFormatter getFormatter()
-
-