Package com._1c.g5.v8.dt.md.copy
Class ModelObjectCopier
java.lang.Object
com._1c.g5.v8.dt.md.copy.ModelObjectCopier
- Direct Known Subclasses:
AttachingModelObjectCopier
Model object copier allows to copy model objects.
Copier allows to copy metadata objects to different target classes, e.g. clients may copy
Document
to Catalog, or even to CatalogAttribute and only matching attributes will be copied.
ModelObjectCopier instances are stateless, may be used multiple times to copy multiple objects and
by multiple threads.
Clients may extend copier and customize copy and attach process.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCopy process context that holds information about copied objects, references, external properties names, etc. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final IEditingLanguageManagerprotected final IModelObjectFactoryprotected static final StringModel objects produced types feature name.protected final IRuntimeVersionSupportprotected final IV8ProjectManager -
Constructor Summary
ConstructorsConstructorDescriptionModelObjectCopier(IV8ProjectManager v8projectManager, IModelObjectFactory modelFactory, IRuntimeVersionSupport runtimeVersionSupport, IEditingLanguageManager editingLanguageManager) Constructor ofModelObjectCopier. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.eclipse.emf.ecore.EObjectattach(org.eclipse.emf.ecore.EObject copy, org.eclipse.emf.ecore.EObject parent, org.eclipse.emf.ecore.EReference reference) Attach the result model object copy using the providedparentobject reference.org.eclipse.emf.ecore.EObjectcopy(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EClass toClass) Copies the given model object and returns a copy of the providedtoClasstype.protected org.eclipse.emf.ecore.EObjectcopy(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EClass toClass, org.eclipse.emf.ecore.EObject targetParent, org.eclipse.emf.ecore.EReference reference, ModelObjectCopier.CopyContext context) Copies the given model object and returns a copy of the providedtoClasstype.org.eclipse.emf.ecore.EObjectcopy(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EObject parent, org.eclipse.emf.ecore.EReference reference) Copies the given model object in appropriate class for the providedparentobject and reference type.<T extends org.eclipse.emf.ecore.EObject>
Tcopy(T eObject) Copies the given model object and returns a copy of the same type.protected voidcopyAccountingFlag(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, org.eclipse.emf.ecore.EObject fromAccountingFlag, ModelObjectCopier.CopyContext context, boolean resolveProxies, boolean useOriginalReferences) Copy reference to the accounting flag getting fromAccountingRegisterResourceprotected voidcopyAttribute(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EAttribute fromAttribute, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EAttribute toAttribute, org.eclipse.emf.ecore.EObject targetParent, org.eclipse.emf.ecore.EReference reference, ModelObjectCopier.CopyContext context) Copy the provided model object attribute.protected voidcopyAttributeValue(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EAttribute eAttribute, Object value, org.eclipse.emf.ecore.EStructuralFeature.Setting setting) Copy the provided model object attribute value.protected <T> Collection<T>copyCollection(Collection<? extends T> eObjects, org.eclipse.emf.ecore.EClass toClass, org.eclipse.emf.ecore.EObject targetParent, org.eclipse.emf.ecore.EReference targetReference, ModelObjectCopier.CopyContext context) Copy the collection of model objects to the providedtoClassant target parent reference.protected voidcopyContainment(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context) Copy the model object containment reference feature.protected voidcopyExternalDataSourceSubObjects(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EObject copyObject, org.eclipse.emf.ecore.EReference toReference, org.eclipse.emf.ecore.EReference fromReference, ModelObjectCopier.CopyContext context) Copies sub objects ofExternalDataSources andCubesprotected voidcopyExternalPropertyReference(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context, boolean resolveProxies, boolean useOriginalReferences) Copy the model object external property reference feature.protected voidcopyFeatureMap(org.eclipse.emf.ecore.util.FeatureMap featureMap, ModelObjectCopier.CopyContext context) Copy the model object feature map.protected voidcopyHelp(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromHelpReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toHelpReference, ModelObjectCopier.CopyContext context) Copy the model objectHelp.protected voidcopyMdName(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EAttribute fromAttribute, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EAttribute toAttribute, org.eclipse.emf.ecore.EObject targetParent, org.eclipse.emf.ecore.EReference reference, ModelObjectCopier.CopyContext context) Copy the metadata model object name.protected voidcopyReference(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context, boolean resolveProxies, boolean useOriginalReferences) Copy the model object non-containment reference feature.protected voidcopyReferenceField(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context, boolean resolveProxies, boolean useOriginalReferences) Copy the model object non-containment reference feature of theFieldtype.protected voidcopyReferenceFields(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context, boolean resolveProxies, boolean useOriginalReferences) Copy the model object non-containment reference feature of theFieldtype.protected voidcopyReferences(ModelObjectCopier.CopyContext context, org.eclipse.emf.ecore.EObject parent, boolean resolveProxies, boolean useOriginalReferences) Copy all references in the providedCopyContextcopies.protected voidcopyReferences(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EObject copyObject, ModelObjectCopier.CopyContext context, org.eclipse.emf.ecore.EObject parent, boolean resolveProxies, boolean useOriginalReferences) Copy all references of the provided copy object.protected voidcopyReferenceSubsystem(Subsystem subsystem, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context, org.eclipse.emf.ecore.EObject parent, boolean resolveProxies, boolean useOriginalReferences) Copy the model object non-containment reference feature from the subsystem object.protected voidcopyReferenceTypeDescription(TypeDescription typeDescription, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject copyEObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context, boolean resolveProxies, boolean useOriginalReferences) Copy the model object non-containment reference feature from the type description object.protected voidcopySourceAsReferenceType(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EObject copyObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context) Copy the source object as reference to source type in the terms of V8 metadata model.protected ModelObjectCopier.CopyContextcreateContext(org.eclipse.emf.ecore.EClass toClass) Creates copy context.protected ModelObjectCopier.CopyContextcreateContext(org.eclipse.emf.ecore.EObject parent, org.eclipse.emf.ecore.EReference reference) Creates copy context.protected org.eclipse.emf.ecore.EObjectcreateCopy(org.eclipse.emf.ecore.EObject sourceObject, org.eclipse.emf.ecore.EClass targetClass, org.eclipse.emf.ecore.EObject targetParent) Create copy object of the provided source object, target class and parent.protected StringgenerateMdCopyName(MdObject sourceObject, MdObject targetObject, org.eclipse.emf.ecore.EObject targetParent, org.eclipse.emf.ecore.EReference reference, ModelObjectCopier.CopyContext copyContext) Generate copied model metadata object name.protected StringgetName(org.eclipse.emf.ecore.EObject object) Returns the name of the provided object ornullif it cannot be obtained.protected org.eclipse.emf.ecore.EStructuralFeaturegetTarget(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature) Returns the target feature used to populate a copy instance from the given source feature.protected org.eclipse.emf.ecore.EStructuralFeature.SettinggetTarget(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EObject copyObject) Returns a setting for the feature and copy instance to be populated with the original object source feature value.protected booleanisAdditionalIndexesReference(org.eclipse.emf.ecore.EReference reference) Returns whether the provided reference is referenced to additional indexes.protected booleanisChanged(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EStructuralFeature fromFeature, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EStructuralFeature toFeature) Returns whether feature value was changed and is needed to copy.protected booleanisExternalProperty(org.eclipse.emf.ecore.EReference reference) Returns whether the provided reference is external property.protected booleanisFormReference(org.eclipse.emf.ecore.EReference reference) Returns whether the provided reference is referenced to form.protected booleanisGraphicalSchemeReference(org.eclipse.emf.ecore.EObject original, org.eclipse.emf.ecore.EObject externalProperty) Returns whether the provided reference is referenced to graphical scheme.protected booleanisHtmlDocumentTemplateReference(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference) Returns whether the provided reference is referenced to template.protected booleanisNotAnnotatedExternalResource(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EObject toObject) Returns whether objects is external resource not annotated in model.protected booleanisProxyAdditionalIndexesReference(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference reference) Returns whether the provided reference is proxy referenced to additional indexes.protected booleanisRightsReference(org.eclipse.emf.ecore.EReference reference) Returns whether the provided reference is referenced to rights.protected booleanisStyleReference(org.eclipse.emf.ecore.EReference reference) Returns whether the provided reference is referenced to style.protected booleannameExists(String nameCandidate, Collection<String> existingNames, ModelObjectCopier.CopyContext copyContext, org.eclipse.emf.ecore.EClass eClass) Returns whether the name candidate already exists in the provided existing name collection or in the provided copy context.protected booleanshouldCopyAttribute(org.eclipse.emf.ecore.EAttribute fromAttribute, org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EAttribute toAttribute, org.eclipse.emf.ecore.EObject toObject, ModelObjectCopier.CopyContext context) Returns whether need to copy the provided attribute.protected booleanshouldCopyContainment(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context) Returns whether need to copy the provided containment reference.protected booleanshouldCopyExternalPropertyReference(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context) Returns whether need to copy the provided external property reference.protected booleanshouldCopyReference(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context) Returns whether need to copy the provided non-containment reference.
-
Field Details
-
PRODUCED_TYPES_FEATURE_NAME
Model objects produced types feature name. Value is "producedTypes".- See Also:
-
v8projectManager
-
modelFactory
-
runtimeVersionSupport
-
editingLanguageManager
-
-
Constructor Details
-
ModelObjectCopier
@Inject public ModelObjectCopier(IV8ProjectManager v8projectManager, IModelObjectFactory modelFactory, IRuntimeVersionSupport runtimeVersionSupport, IEditingLanguageManager editingLanguageManager) Constructor ofModelObjectCopier.- Parameters:
v8projectManager- the V8 project manager, cannot benullmodelFactory- the model object factory, cannot benullruntimeVersionSupport- the 1C:Enterprise runtime version support, cannot benulleditingLanguageManager- the editing language manager, cannot benull
-
-
Method Details
-
copy
public <T extends org.eclipse.emf.ecore.EObject> T copy(T eObject) Copies the given model object and returns a copy of the same type.- Parameters:
eObject- the model object to copy, cannot benull- Returns:
- a copy of the same type, never
null
-
copy
public org.eclipse.emf.ecore.EObject copy(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EClass toClass) Copies the given model object and returns a copy of the providedtoClasstype. Copies only matched features.This method allows to copy metadata objects to different target classes, e.g. clients may copy
DocumenttoCatalog, or even toCatalogAttributeand only matching attributes will be copied.- Parameters:
eObject- the model object to copy, cannot benulltoClass- the result model class, cannot benull- Returns:
- a copy of the provided type, never
null
-
copy
public org.eclipse.emf.ecore.EObject copy(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EObject parent, org.eclipse.emf.ecore.EReference reference) Copies the given model object in appropriate class for the providedparentobject and reference type.This method allows to copy metadata objects to different target classes, e.g. clients may copy
DocumenttoCatalog, or even toCatalogAttributeand only matching attributes will be copied.- Parameters:
eObject- the model object to copy, cannot benullparent- the target parent, cannot benullreference- the reference parent, cannot benull- Returns:
- a copy of the appropriate type, never
null
-
attach
protected org.eclipse.emf.ecore.EObject attach(org.eclipse.emf.ecore.EObject copy, org.eclipse.emf.ecore.EObject parent, org.eclipse.emf.ecore.EReference reference) Attach the result model object copy using the providedparentobject reference. Returns attached object. Method is called after source object copy and before its references copy.- Parameters:
copy- the model object copy to attach, cannot benullparent- the target parent, cannot benullreference- the parent reference, cannot benull- Returns:
- the attached object, never
null
-
copy
protected org.eclipse.emf.ecore.EObject copy(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EClass toClass, org.eclipse.emf.ecore.EObject targetParent, org.eclipse.emf.ecore.EReference reference, ModelObjectCopier.CopyContext context) Copies the given model object and returns a copy of the providedtoClasstype. Copies only matched features.- Parameters:
eObject- the model object to copy, cannot benulltoClass- the result model class, cannot benulltargetParent- the target parent to copy to ornullif nonereference- the parent reference to copy to ornullif nonecontext- the copy context, cannot benull- Returns:
- a copy of the provided type, never
null
-
copyAttribute
protected void copyAttribute(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EAttribute fromAttribute, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EAttribute toAttribute, org.eclipse.emf.ecore.EObject targetParent, org.eclipse.emf.ecore.EReference reference, ModelObjectCopier.CopyContext context) Copy the provided model object attribute.- Parameters:
fromObject- the object to copy attribute from, cannot benullfromAttribute- the attribute to copy value from, cannot benullfromObject- the object to copy attribute to, cannot benullfromAttribute- the attribute to copy value to, cannot benulltargetParent- the target parent to copy to ornullif nonereference- the parent reference to copy to ornullif nonecontext- the copy context, cannot benull
-
copyAttributeValue
protected void copyAttributeValue(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EAttribute eAttribute, Object value, org.eclipse.emf.ecore.EStructuralFeature.Setting setting) Copy the provided model object attribute value.- Parameters:
eObject- the object to copy attribute to, cannot benulleAttribute- the attribute to copy value to, cannot benullvalue- the value to copy, cannot benullsetting- the feature setting, cannot benull
-
copyCollection
protected <T> Collection<T> copyCollection(Collection<? extends T> eObjects, org.eclipse.emf.ecore.EClass toClass, org.eclipse.emf.ecore.EObject targetParent, org.eclipse.emf.ecore.EReference targetReference, ModelObjectCopier.CopyContext context) Copy the collection of model objects to the providedtoClassant target parent reference.- Parameters:
eObjects- the objects to copy, cannot benulltoClass- the result model class, cannot benulltargetParent- the target parent, cannot benulltargetReference- the reference parent, cannot benullcontext- the copy context, cannot benull- Returns:
- a copied collection, never
null
-
copyContainment
protected void copyContainment(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context) Copy the model object containment reference feature.- Parameters:
fromObject- the object to copy containment reference feature from, cannot benullfromReference- the containment reference feature to copy, cannot benulltoObject- the object to copy containment reference feature to, cannot benulltoReference- the containment reference feature to copy, cannot benullcontext- the copy context, cannot benull
-
copyExternalPropertyReference
protected void copyExternalPropertyReference(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context, boolean resolveProxies, boolean useOriginalReferences) Copy the model object external property reference feature.- Parameters:
fromObject- the object to copy external property from, cannot benullfromReference- the external property to copy, cannot benulltoObject- the object to copy external property to, cannot benulltoReference- the external property to copy to, cannot benullcontext- the copy context, cannot benullresolveProxies- whether proxies should be resolved while copyinguseOriginalReferences- whether non-copied references should be used while copying
-
copyFeatureMap
protected void copyFeatureMap(org.eclipse.emf.ecore.util.FeatureMap featureMap, ModelObjectCopier.CopyContext context) Copy the model object feature map.- Parameters:
featureMap- the feature map to copy, cannot benullcontext- the copy context, cannot benull
-
copyHelp
protected void copyHelp(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromHelpReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toHelpReference, ModelObjectCopier.CopyContext context) Copy the model objectHelp.- Parameters:
fromObject- the object to copy help from, cannot benullfromHelpReference- the help reference to copy, cannot benulltoObject- the object to copy help to, cannot benulltoHelpReference- the help reference to copy to, cannot benullcontext- the copy context, cannot benull
-
copyMdName
protected void copyMdName(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EAttribute fromAttribute, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EAttribute toAttribute, org.eclipse.emf.ecore.EObject targetParent, org.eclipse.emf.ecore.EReference reference, ModelObjectCopier.CopyContext context) Copy the metadata model object name.- Parameters:
fromObject- the object to copy name from, cannot benullfromAttribute- the name attribute to copy, cannot benulltoObject- the object to copy name to, cannot benulltoAttribute- the name attribute to copy to, cannot benulltargetParent- the target parent to copy to ornullif nonereference- the parent reference to copy to ornullif nonecontext- the copy context, cannot benull
-
copyReference
protected void copyReference(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context, boolean resolveProxies, boolean useOriginalReferences) Copy the model object non-containment reference feature.- Parameters:
fromObject- the object to copy reference feature from, cannot benullfromReference- the reference feature to copy, cannot benulltoObject- the object to copy reference feature to, cannot benulltoReference- the reference feature to copy, cannot benullcontext- the copy context, cannot benullresolveProxies- whether proxies should be resolved while copyinguseOriginalReferences- whether non-copied references should be used while copying
-
copyReferenceFields
protected void copyReferenceFields(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context, boolean resolveProxies, boolean useOriginalReferences) Copy the model object non-containment reference feature of theFieldtype.- Parameters:
fromObject- the object to copy reference feature from, cannot benullfromReference- the reference feature to copy, cannot benulltoObject- the object to copy reference feature to, cannot benulltoReference- the reference feature to copy, cannot benullcontext- the copy context, cannot benullresolveProxies- whether proxies should be resolved while copyinguseOriginalReferences- whether non-copied references should be used while copying
-
copyReferenceField
protected void copyReferenceField(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context, boolean resolveProxies, boolean useOriginalReferences) Copy the model object non-containment reference feature of theFieldtype.- Parameters:
fromObject- the object to copy reference feature from, cannot benullfromReference- the reference feature to copy, cannot benulltoObject- the object to copy reference feature to, cannot benulltoReference- the reference feature to copy, cannot benullcontext- the copy context, cannot benullresolveProxies- whether proxies should be resolved while copyinguseOriginalReferences- whether non-copied references should be used while copying
-
copyReferences
protected void copyReferences(ModelObjectCopier.CopyContext context, org.eclipse.emf.ecore.EObject parent, boolean resolveProxies, boolean useOriginalReferences) Copy all references in the providedCopyContextcopies.- Parameters:
context- the copy context, cannot benullparent- the parent, can benullresolveProxies- whether proxies should be resolved while copyinguseOriginalReferences- whether non-copied references should be used while copying
-
copyReferences
protected void copyReferences(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EObject copyObject, ModelObjectCopier.CopyContext context, org.eclipse.emf.ecore.EObject parent, boolean resolveProxies, boolean useOriginalReferences) Copy all references of the provided copy object.- Parameters:
eObject- the original object, cannot benullcopyObject- the copied object, cannot benullcontext- the copy context, cannot benullparent- the parent, can benullresolveProxies- whether proxies should be resolved while copyinguseOriginalReferences- whether non-copied references should be used while copying
-
copyAccountingFlag
protected void copyAccountingFlag(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, org.eclipse.emf.ecore.EObject fromAccountingFlag, ModelObjectCopier.CopyContext context, boolean resolveProxies, boolean useOriginalReferences) Copy reference to the accounting flag getting fromAccountingRegisterResource- Parameters:
fromObject- the object to copy reference feature from, cannot benullfromReference- the reference feature to copy, cannot benulltoObject- the object to copy reference feature to, cannot benulltoReference- the reference feature to copy, cannot benullfromAccountingFlag- original accounting flag of AccountRegister, cannot benullcontext- the copy context, cannot benullresolveProxies- whether proxies should be resolved while copyinguseOriginalReferences- whether non-copied references should be used while copying
-
copyReferenceSubsystem
protected void copyReferenceSubsystem(Subsystem subsystem, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context, org.eclipse.emf.ecore.EObject parent, boolean resolveProxies, boolean useOriginalReferences) Copy the model object non-containment reference feature from the subsystem object.- Parameters:
subsystem- the object to copy reference feature from, cannot benullfromReference- the reference feature to copy, cannot benulltoObject- the object to copy reference feature to, cannot benulltoReference- the reference feature to copy, cannot benullcontext- the copy context, cannot benullparent- the parent, can benullresolveProxies- whether proxies should be resolved while copyinguseOriginalReferences- whether non-copied references should be used while copying
-
copyReferenceTypeDescription
protected void copyReferenceTypeDescription(TypeDescription typeDescription, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject copyEObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context, boolean resolveProxies, boolean useOriginalReferences) Copy the model object non-containment reference feature from the type description object.- Parameters:
typeDescription- the object to copy reference feature from, cannot benullfromReference- the reference feature to copy, cannot benulltoObject- the object to copy reference feature to, cannot benulltoReference- the reference feature to copy, cannot benullcontext- the copy context, cannot benullresolveProxies- whether proxies should be resolved while copyinguseOriginalReferences- whether non-copied references should be used while copying
-
copySourceAsReferenceType
protected void copySourceAsReferenceType(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EObject copyObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context) Copy the source object as reference to source type in the terms of V8 metadata model. If cannot copy then do nothing.- Parameters:
eObject- the original object, cannot benullcopyObject- the copied object, cannot benulltoReference- the type description reference to copy source as type to, cannot benullcontext- the copy context, cannot benull
-
createContext
Creates copy context. Subclasses may override and provide more specific copy context.- Parameters:
toClass- the result model class, cannot benull- Returns:
- the created copy context, never
null
-
createContext
protected ModelObjectCopier.CopyContext createContext(org.eclipse.emf.ecore.EObject parent, org.eclipse.emf.ecore.EReference reference) Creates copy context. Subclasses may override and provide more specific copy context.- Parameters:
parent- the target parent, cannot benullreference- the reference parent, cannot benull- Returns:
- the created copy context, never
null
-
createCopy
protected org.eclipse.emf.ecore.EObject createCopy(org.eclipse.emf.ecore.EObject sourceObject, org.eclipse.emf.ecore.EClass targetClass, org.eclipse.emf.ecore.EObject targetParent) Create copy object of the provided source object, target class and parent.- Parameters:
sourceObject- the source object to copy, cannot benulltargetClass- the result model class, cannot benulltargetParent- the result model parent, cannot benull- Returns:
- the created model copy object, never
null
-
nameExists
protected boolean nameExists(String nameCandidate, Collection<String> existingNames, ModelObjectCopier.CopyContext copyContext, org.eclipse.emf.ecore.EClass eClass) Returns whether the name candidate already exists in the provided existing name collection or in the provided copy context.- Parameters:
nameCandidate- the name candidate to check, cannot benullexistingNames- the existing name collection to check for, cannot benullcopyContext- the copy context to check for, cannot benulleClass- the class of the candidate, cannot benull- Returns:
- whether the name candidate already exists in the provided existing name collection or in the provided copy context
-
generateMdCopyName
protected String generateMdCopyName(MdObject sourceObject, MdObject targetObject, org.eclipse.emf.ecore.EObject targetParent, org.eclipse.emf.ecore.EReference reference, ModelObjectCopier.CopyContext copyContext) Generate copied model metadata object name.- Parameters:
sourceObject- the source object to copy, cannot benulltargetObject- the target object to copy, cannot benulltargetParent- the target parent to copy to ornullif nonereference- the parent reference to copy to ornullif nonecontext- the copy context, cannot benull- Returns:
- the copied model metadata object name, never
null
-
getName
Returns the name of the provided object ornullif it cannot be obtained.- Parameters:
object- the model object to get name of, cannot benull- Returns:
- the name of the provided object or
nullif it cannot be obtained
-
getTarget
protected org.eclipse.emf.ecore.EStructuralFeature getTarget(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature) Returns the target feature used to populate a copy instance from the given source feature.- Parameters:
eStructuralFeature- the source feature, cannot benull- Returns:
- the target feature used to populate a copy instance, or
nullif none
-
getTarget
protected org.eclipse.emf.ecore.EStructuralFeature.Setting getTarget(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EObject copyObject) Returns a setting for the feature and copy instance to be populated with the original object source feature value.- Parameters:
eStructuralFeature- the source feature, cannot benulleObject- the original object, cannot benullcopyObject- the copied object, cannot benull- Returns:
- the target feature used to populate a copy instance.
-
isFormReference
protected boolean isFormReference(org.eclipse.emf.ecore.EReference reference) Returns whether the provided reference is referenced to form.- Parameters:
reference- the reference to check, cannot benull- Returns:
- whether the provided reference is referenced to form.
-
isStyleReference
protected boolean isStyleReference(org.eclipse.emf.ecore.EReference reference) Returns whether the provided reference is referenced to style.- Parameters:
reference- the reference to check, cannot benull- Returns:
- whether the provided reference is referenced to style.
-
isAdditionalIndexesReference
protected boolean isAdditionalIndexesReference(org.eclipse.emf.ecore.EReference reference) Returns whether the provided reference is referenced to additional indexes.- Parameters:
reference- the reference to check, cannot benull- Returns:
- whether the provided reference is referenced to additional indexes.
-
isProxyAdditionalIndexesReference
protected boolean isProxyAdditionalIndexesReference(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference reference) Returns whether the provided reference is proxy referenced to additional indexes.- Parameters:
eObject- the object to copy from, cannot benullreference- the reference to check, cannot benull- Returns:
- whether the provided reference is proxy referenced to additional indexes.
-
isGraphicalSchemeReference
protected boolean isGraphicalSchemeReference(org.eclipse.emf.ecore.EObject original, org.eclipse.emf.ecore.EObject externalProperty) Returns whether the provided reference is referenced to graphical scheme.- Parameters:
original- original copying object, can't benullexternalProperty- the external property, cannot benull- Returns:
- whether the provided reference is referenced to graphical scheme.
-
isRightsReference
protected boolean isRightsReference(org.eclipse.emf.ecore.EReference reference) Returns whether the provided reference is referenced to rights.- Parameters:
reference- the reference to check, cannot benull- Returns:
- whether the provided reference is referenced to rights.
-
isNotAnnotatedExternalResource
protected boolean isNotAnnotatedExternalResource(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EObject toObject) Returns whether objects is external resource not annotated in model.- Parameters:
fromObject- the object to copy from, cannot benulltoObject- the object to copy to, cannot benull- Returns:
- whether objects is external resource not annotated in model.
-
isHtmlDocumentTemplateReference
protected boolean isHtmlDocumentTemplateReference(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference) Returns whether the provided reference is referenced to template.- Parameters:
context- the context object to check, cannot benullreference- the reference to check, cannot benull- Returns:
- whether the provided reference is referenced to template.
-
isChanged
protected boolean isChanged(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EStructuralFeature fromFeature, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EStructuralFeature toFeature) Returns whether feature value was changed and is needed to copy.- Parameters:
fromObject- the object to copy feature from, cannot benullfromFeature- the feature to copy, cannot benulltoObject- the object to copy feature to, cannot benulltoFeature- the feature to copy, cannot benull- Returns:
- whether feature value was changed and is needed to copy
-
isExternalProperty
protected boolean isExternalProperty(org.eclipse.emf.ecore.EReference reference) Returns whether the provided reference is external property.- Parameters:
reference- the reference to check, cannot benull- Returns:
- whether the provided reference is external property
-
shouldCopyAttribute
protected boolean shouldCopyAttribute(org.eclipse.emf.ecore.EAttribute fromAttribute, org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EAttribute toAttribute, org.eclipse.emf.ecore.EObject toObject, ModelObjectCopier.CopyContext context) Returns whether need to copy the provided attribute. Default implementation copy allows to copy all attributes except metadata UUID.- Parameters:
fromObject- the object to copy attribute from, cannot benullfromAttribute- the attribute to copy value from, cannot benullfromObject- the object to copy attribute to, cannot benullfromAttribute- the attribute to copy value to, cannot benullcontext- the copy context, cannot benull- Returns:
- whether need to copy the provided attribute
-
shouldCopyContainment
protected boolean shouldCopyContainment(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context) Returns whether need to copy the provided containment reference. Default implementation allows to copy all non-transient containment references exceptproducedTypesreference.- Parameters:
fromObject- the object to copy containment reference feature from, cannot benullfromReference- the containment reference feature to copy, cannot benulltoObject- the object to copy containment reference feature to, cannot benulltoReference- the containment reference feature to copy, cannot benullcontext- the copy context, cannot benull- Returns:
- whether need to copy the provided containment reference
-
shouldCopyReference
protected boolean shouldCopyReference(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context) Returns whether need to copy the provided non-containment reference. Default implementation allows to copy all non-transient references and external properties references.- Parameters:
fromObject- the object to copy non-containment reference feature from, cannot benullfromReference- the non-containment reference feature to copy, cannot benulltoObject- the object to copy non-containment reference feature to, cannot benulltoReference- the non-containment reference feature to copy, cannot benullcontext- the copy context, cannot benull- Returns:
- whether need to copy the provided non-containment reference
-
shouldCopyExternalPropertyReference
protected boolean shouldCopyExternalPropertyReference(org.eclipse.emf.ecore.EObject fromObject, org.eclipse.emf.ecore.EReference fromReference, org.eclipse.emf.ecore.EObject toObject, org.eclipse.emf.ecore.EReference toReference, ModelObjectCopier.CopyContext context) Returns whether need to copy the provided external property reference. Default implementation always returnstrue.- Parameters:
fromObject- the object to copy external property reference feature from, cannot benullfromReference- the external property reference feature to copy, cannot benulltoObject- the object to copy external property reference feature to, cannot benulltoReference- the external property reference feature to copy, cannot benullcontext- the copy context, cannot benull- Returns:
- whether need to copy the provided external property reference
-
copyExternalDataSourceSubObjects
protected void copyExternalDataSourceSubObjects(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EObject copyObject, org.eclipse.emf.ecore.EReference toReference, org.eclipse.emf.ecore.EReference fromReference, ModelObjectCopier.CopyContext context) Copies sub objects ofExternalDataSources andCubes- Parameters:
eObject- the object to copy sub objects from, cannot benullcopyObject- the object to copy sub objects to, cannot benulltoReference- the sub objects reference feature to copy, cannot benullfromReference- the sub objects reference feature to copy, cannot benullcontext- the copy context, cannot benull
-