Class ExecutableHierarchyImporterNode
- java.lang.Object
-
- com._1c.g5.v8.dt.import_.xml.hierarchy.node.AbstractHierarchyImporterNode
-
- com._1c.g5.v8.dt.import_.xml.hierarchy.node.ExecutableHierarchyImporterNode
-
- All Implemented Interfaces:
IHierarchyImporterNode
- Direct Known Subclasses:
HierarchyImporterStatusNode
public class ExecutableHierarchyImporterNode extends AbstractHierarchyImporterNode
Basic implementation of executable import node
Used for execute
Client must be implementation of this classIHierarchyImportExecutor
from hierarchy importer context. After completing import task of this node will be launched imports child nodes and after completing save tasks of all children nodes will be launched save task of this node.
-
-
Field Summary
-
Fields inherited from class com._1c.g5.v8.dt.import_.xml.hierarchy.node.AbstractHierarchyImporterNode
debug
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ExecutableHierarchyImporterNode(IHierarchyImporterContext importerContext, Path source)
Create instance ofExecutableHierarchyImporterNode
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
createAndSaveResource(org.eclipse.emf.ecore.EObject eObject, org.eclipse.core.runtime.IPath location, org.eclipse.core.runtime.IPath relative, String projectName)
Creates a resource with the model object in the provided location using relative path inside location and saves it.org.eclipse.core.runtime.IStatus
doImport()
Do import workprotected org.eclipse.core.runtime.IStatus
error(Exception e)
Create error status with the given exception content.void
executeImport(Collection<org.eclipse.core.runtime.IStatus> statuses)
Run action of importing data-
Methods inherited from class com._1c.g5.v8.dt.import_.xml.hierarchy.node.AbstractHierarchyImporterNode
addChildNode, addIndependentChildNode, clear, getChildrenNodes, getImporterContext, getIndependentChildrenNodes, getParentNode, getSource, removeChildNode, rootRelativePath, setParentNode
-
-
-
-
Constructor Detail
-
ExecutableHierarchyImporterNode
protected ExecutableHierarchyImporterNode(IHierarchyImporterContext importerContext, Path source)
Create instance ofExecutableHierarchyImporterNode
- Parameters:
importerContext
- the importer context info (notnull
)source
- the path to importing file (notnull
)
-
-
Method Detail
-
executeImport
public void executeImport(Collection<org.eclipse.core.runtime.IStatus> statuses)
Description copied from interface:IHierarchyImporterNode
Run action of importing data- Parameters:
statuses
- a collection the result statuses of all the operations will be added into, notnull
-
doImport
public org.eclipse.core.runtime.IStatus doImport()
Do import work- Returns:
- the result status of import work
-
createAndSaveResource
protected void createAndSaveResource(org.eclipse.emf.ecore.EObject eObject, org.eclipse.core.runtime.IPath location, org.eclipse.core.runtime.IPath relative, String projectName) throws IOException
Creates a resource with the model object in the provided location using relative path inside location and saves it.- Parameters:
eObject
- the model object to save (notnull
)location
- the path to file in which will be saved new resource (notnull
)relative
- the relative path inside location to use (notnull
)projectName
- the project name to use for model object URI creation (notnull
)- Throws:
IOException
- if create or save resource failed
-
error
protected org.eclipse.core.runtime.IStatus error(Exception e)
Create error status with the given exception content.- Parameters:
e
- the exception to report, cannot benull
- Returns:
- an error status with the given exception content, never
null
-
-