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
public static class ModelObjectCopier.CopyContext extends Object
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
Fields Modifier and Type Field Description protected List<org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EObject>>copiedExternalReferencesprotected Map<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EObject>copiedExternalResoucesprotected Map<org.eclipse.emf.ecore.EClass,List<String>>copiedNamesprotected List<org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,Object>>copiedReferencesprotected Map<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EObject>copies
-
Constructor Summary
Constructors Constructor Description CopyContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCopy(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject copy)Add copy to the context.voidaddCreatedName(org.eclipse.emf.ecore.EClass eClass, String name)Add created unique name to the context.voidaddExternalReference(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.voidaddExternalResource(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject copy)Add external resource copy objects to the context.voidaddReference(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>>getCopiedExternalReferences()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>>getCopiedReferences()Returns all context copied references as triples: the reference owner object.Map<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EObject>getCopies()Returns map of all context copies: original to its copy.List<String>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>getExternalResources()Returns map of all context object with external resource copies: original to its copy.
-
-
-
Field Detail
-
copies
protected Map<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EObject> copies
-
copiedExternalResouces
protected Map<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EObject> copiedExternalResouces
-
copiedExternalReferences
protected List<org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EObject>> copiedExternalReferences
-
-
Method Detail
-
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 benullcopy- the copy object, cannot benull
-
addCreatedName
public void addCreatedName(org.eclipse.emf.ecore.EClass eClass, String name)Add created unique name to the context.- Parameters:
eClass- the created class, cannot benullname- 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 benulltoReference- the reference feature, cannot benullvalue- the reference value, must beEObjector 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 benulltoReference- the external reference feature, cannot benullexternalProperty- 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 benullcopy- 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,org.eclipse.emf.ecore.EObject>> getCopiedExternalReferences()
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,Object>> getCopiedReferences()
Returns all context copied references as triples:- the reference owner object.
- the reference feature.
- the reference value,
EObjector a collection ofEObject.
- Returns:
- all context copied external references, never
null
-
getCopies
public Map<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EObject> 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
public List<String> getCreatedNames(org.eclipse.emf.ecore.EClass eClass)
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
public Map<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EObject> 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
-
-