Package com._1c.g5.v8.dt.md.copy
Class ModelObjectCopier.CopyContext
java.lang.Object
com._1c.g5.v8.dt.md.copy.ModelObjectCopier.CopyContext
- Direct Known Subclasses:
AttachingModelObjectCopier.SharedCopyContext
- Enclosing class:
- ModelObjectCopier
Copy process context that holds information about copied objects, references, external properties names,
etc. Context is passed through all copy methods to share state between them.
Copy context is stateful and not safe for use by multiple threads.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,
org.eclipse.emf.ecore.EReference, org.eclipse.emf.ecore.EObject>> protected Map<org.eclipse.emf.ecore.EObject,
org.eclipse.emf.ecore.EObject> protected List<org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,
org.eclipse.emf.ecore.EReference, Object>> protected Map<org.eclipse.emf.ecore.EObject,
org.eclipse.emf.ecore.EObject> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCopy
(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject copy) Add copy to the context.void
addCreatedName
(org.eclipse.emf.ecore.EClass eClass, String name) Add created unique name to the context.void
addExternalReference
(org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, org.eclipse.emf.ecore.EObject externalProperty) Add created external reference to the context.void
addExternalResource
(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject copy) Add external resource copy objects to the context.void
addReference
(org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, Object value) Add created reference to the context.List<org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,
org.eclipse.emf.ecore.EReference, org.eclipse.emf.ecore.EObject>> Returns all context copied external references as triples: the external reference owner object.List<org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,
org.eclipse.emf.ecore.EReference, Object>> Returns all context copied references as triples: the reference owner object.Map<org.eclipse.emf.ecore.EObject,
org.eclipse.emf.ecore.EObject> Returns map of all context copies: original to its copy.getCreatedNames
(org.eclipse.emf.ecore.EClass eClass) Returns created names for the provided modelEClass
.Map<org.eclipse.emf.ecore.EObject,
org.eclipse.emf.ecore.EObject> Returns map of all context object with external resource copies: original to its copy.
-
Field Details
-
copies
-
copiedNames
-
copiedExternalResouces
-
copiedExternalReferences
protected List<org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference, copiedExternalReferencesorg.eclipse.emf.ecore.EObject>> -
copiedReferences
-
-
Constructor Details
-
CopyContext
public CopyContext()
-
-
Method Details
-
addCopy
public void addCopy(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject copy) Add copy to the context.- Parameters:
source
- the source object, cannot benull
copy
- the copy object, cannot benull
-
addCreatedName
Add created unique name to the context.- Parameters:
eClass
- the created class, cannot benull
name
- the created name, cannot benull
-
addReference
public void addReference(org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, Object value) Add created reference to the context.- Parameters:
toObject
- the reference owner object, cannot benull
toReference
- the reference feature, cannot benull
value
- the reference value, must beEObject
or a collection ofEObject
, cannot benull
-
addExternalReference
public void addExternalReference(org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, org.eclipse.emf.ecore.EObject externalProperty) Add created external reference to the context.- Parameters:
toObject
- the external reference owner object, cannot benull
toReference
- the external reference feature, cannot benull
externalProperty
- the external reference, cannot benull
-
addExternalResource
public void addExternalResource(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject copy) Add external resource copy objects to the context.- Parameters:
source
- the source external resource object, cannot benull
copy
- the copy external resource object, cannot benull
-
getCopiedExternalReferences
public List<org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference, getCopiedExternalReferences()org.eclipse.emf.ecore.EObject>> Returns all context copied external references as triples:- the external reference owner object.
- the external reference feature.
- the external reference.
- Returns:
- all context copied external references, never
null
-
getCopiedReferences
public List<org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference, getCopiedReferences()Object>> Returns all context copied references as triples:- the reference owner object.
- the reference feature.
- the reference value,
EObject
or a collection ofEObject
.
- Returns:
- all context copied external references, never
null
-
getCopies
Returns map of all context copies: original to its copy.- Returns:
- a map of all context copies: original to its copy, never
null
-
getCreatedNames
Returns created names for the provided modelEClass
.- Parameters:
eClass
- the created class, cannot benull
- Returns:
- a list of created names for the provided model
EClass
, nevernull
-
getExternalResources
Returns map of all context object with external resource copies: original to its copy.- Returns:
- a map of all context object with external resource copies: original to its copy, never
null
-