Class ModelObjectCopier

java.lang.Object
com._1c.g5.v8.dt.md.copy.ModelObjectCopier
Direct Known Subclasses:
AttachingModelObjectCopier

public class ModelObjectCopier extends Object
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 Classes
    Modifier and Type
    Class
    Description
    static class 
    Copy process context that holds information about copied objects, references, external properties names, etc.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final IEditingLanguageManager
     
    protected final IModelObjectFactory
     
    protected static final String
    Model objects produced types feature name.
    protected final IRuntimeVersionSupport
     
    protected final IV8ProjectManager
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ModelObjectCopier(IV8ProjectManager v8projectManager, IModelObjectFactory modelFactory, IRuntimeVersionSupport runtimeVersionSupport, IEditingLanguageManager editingLanguageManager)
    Constructor of ModelObjectCopier.
  • Method Summary

    Modifier and Type
    Method
    Description
    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 provided parent object reference.
    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 provided toClass type.
    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 provided toClass type.
    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 provided parent object and reference type.
    <T extends org.eclipse.emf.ecore.EObject>
    T
    copy(T eObject)
    Copies the given model object and returns a copy of the same type.
    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 from AccountingRegisterResource
    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.
    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.
    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 provided toClass ant target parent reference.
    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.
    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 of ExternalDataSources and Cubes
    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.
    protected void
    copyFeatureMap(org.eclipse.emf.ecore.util.FeatureMap featureMap, ModelObjectCopier.CopyContext context)
    Copy the model object feature map.
    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 object Help.
    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.
    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.
    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 the Field type.
    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 the Field type.
    protected void
    copyReferences(ModelObjectCopier.CopyContext context, org.eclipse.emf.ecore.EObject parent, boolean resolveProxies, boolean useOriginalReferences)
    Copy all references in the provided CopyContext copies.
    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.
    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.
    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.
    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.
    createContext(org.eclipse.emf.ecore.EClass toClass)
    Creates copy context.
    createContext(org.eclipse.emf.ecore.EObject parent, org.eclipse.emf.ecore.EReference reference)
    Creates copy context.
    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.
    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.
    protected String
    getName(org.eclipse.emf.ecore.EObject object)
    Returns the name of the provided object or null if it cannot be obtained.
    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.
    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.
    protected boolean
    isAdditionalIndexesReference(org.eclipse.emf.ecore.EReference reference)
    Returns whether the provided reference is referenced to additional indexes.
    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.
    protected boolean
    isExternalProperty(org.eclipse.emf.ecore.EReference reference)
    Returns whether the provided reference is external property.
    protected boolean
    isFormReference(org.eclipse.emf.ecore.EReference reference)
    Returns whether the provided reference is referenced to form.
    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.
    protected boolean
    isHtmlDocumentTemplateReference(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)
    Returns whether the provided reference is referenced to template.
    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.
    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.
    protected boolean
    isRightsReference(org.eclipse.emf.ecore.EReference reference)
    Returns whether the provided reference is referenced to rights.
    protected boolean
    isStyleReference(org.eclipse.emf.ecore.EReference reference)
    Returns whether the provided reference is referenced to style.
    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.
    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.
    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.
    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.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ModelObjectCopier

      @Inject public ModelObjectCopier(IV8ProjectManager v8projectManager, IModelObjectFactory modelFactory, IRuntimeVersionSupport runtimeVersionSupport, IEditingLanguageManager editingLanguageManager)
      Constructor of ModelObjectCopier.
      Parameters:
      v8projectManager - the V8 project manager, cannot be null
      modelFactory - the model object factory, cannot be null
      runtimeVersionSupport - the 1C:Enterprise runtime version support, cannot be null
      editingLanguageManager - the editing language manager, cannot be null
  • 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 be null
      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 provided toClass type. Copies only matched features.

      This method 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.

      Parameters:
      eObject - the model object to copy, cannot be null
      toClass - the result model class, cannot be null
      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 provided parent object and reference type.

      This method 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.

      Parameters:
      eObject - the model object to copy, cannot be null
      parent - the target parent, cannot be null
      reference - the reference parent, cannot be null
      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 provided parent object 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 be null
      parent - the target parent, cannot be null
      reference - the parent reference, cannot be null
      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 provided toClass type. Copies only matched features.
      Parameters:
      eObject - the model object to copy, cannot be null
      toClass - the result model class, cannot be null
      targetParent - the target parent to copy to or null if none
      reference - the parent reference to copy to or null if none
      context - the copy context, cannot be null
      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 be null
      fromAttribute - the attribute to copy value from, cannot be null
      fromObject - the object to copy attribute to, cannot be null
      fromAttribute - the attribute to copy value to, cannot be null
      targetParent - the target parent to copy to or null if none
      reference - the parent reference to copy to or null if none
      context - the copy context, cannot be null
    • 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 be null
      eAttribute - the attribute to copy value to, cannot be null
      value - the value to copy, cannot be null
      setting - the feature setting, cannot be null
    • 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 provided toClass ant target parent reference.
      Parameters:
      eObjects - the objects to copy, cannot be null
      toClass - the result model class, cannot be null
      targetParent - the target parent, cannot be null
      targetReference - the reference parent, cannot be null
      context - the copy context, cannot be null
      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 be null
      fromReference - the containment reference feature to copy, cannot be null
      toObject - the object to copy containment reference feature to, cannot be null
      toReference - the containment reference feature to copy, cannot be null
      context - the copy context, cannot be null
    • 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 be null
      fromReference - the external property to copy, cannot be null
      toObject - the object to copy external property to, cannot be null
      toReference - the external property to copy to, cannot be null
      context - the copy context, cannot be null
      resolveProxies - whether proxies should be resolved while copying
      useOriginalReferences - 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 be null
      context - the copy context, cannot be null
    • 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 object Help.
      Parameters:
      fromObject - the object to copy help from, cannot be null
      fromHelpReference - the help reference to copy, cannot be null
      toObject - the object to copy help to, cannot be null
      toHelpReference - the help reference to copy to, cannot be null
      context - the copy context, cannot be null
    • 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 be null
      fromAttribute - the name attribute to copy, cannot be null
      toObject - the object to copy name to, cannot be null
      toAttribute - the name attribute to copy to, cannot be null
      targetParent - the target parent to copy to or null if none
      reference - the parent reference to copy to or null if none
      context - the copy context, cannot be null
    • 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 be null
      fromReference - the reference feature to copy, cannot be null
      toObject - the object to copy reference feature to, cannot be null
      toReference - the reference feature to copy, cannot be null
      context - the copy context, cannot be null
      resolveProxies - whether proxies should be resolved while copying
      useOriginalReferences - 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 the Field type.
      Parameters:
      fromObject - the object to copy reference feature from, cannot be null
      fromReference - the reference feature to copy, cannot be null
      toObject - the object to copy reference feature to, cannot be null
      toReference - the reference feature to copy, cannot be null
      context - the copy context, cannot be null
      resolveProxies - whether proxies should be resolved while copying
      useOriginalReferences - 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 the Field type.
      Parameters:
      fromObject - the object to copy reference feature from, cannot be null
      fromReference - the reference feature to copy, cannot be null
      toObject - the object to copy reference feature to, cannot be null
      toReference - the reference feature to copy, cannot be null
      context - the copy context, cannot be null
      resolveProxies - whether proxies should be resolved while copying
      useOriginalReferences - 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 provided CopyContext copies.
      Parameters:
      context - the copy context, cannot be null
      parent - the parent, can be null
      resolveProxies - whether proxies should be resolved while copying
      useOriginalReferences - 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 be null
      copyObject - the copied object, cannot be null
      context - the copy context, cannot be null
      parent - the parent, can be null
      resolveProxies - whether proxies should be resolved while copying
      useOriginalReferences - 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 from AccountingRegisterResource
      Parameters:
      fromObject - the object to copy reference feature from, cannot be null
      fromReference - the reference feature to copy, cannot be null
      toObject - the object to copy reference feature to, cannot be null
      toReference - the reference feature to copy, cannot be null
      fromAccountingFlag - original accounting flag of AccountRegister, cannot be null
      context - the copy context, cannot be null
      resolveProxies - whether proxies should be resolved while copying
      useOriginalReferences - 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 be null
      fromReference - the reference feature to copy, cannot be null
      toObject - the object to copy reference feature to, cannot be null
      toReference - the reference feature to copy, cannot be null
      context - the copy context, cannot be null
      parent - the parent, can be null
      resolveProxies - whether proxies should be resolved while copying
      useOriginalReferences - 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 be null
      fromReference - the reference feature to copy, cannot be null
      toObject - the object to copy reference feature to, cannot be null
      toReference - the reference feature to copy, cannot be null
      context - the copy context, cannot be null
      resolveProxies - whether proxies should be resolved while copying
      useOriginalReferences - 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 be null
      copyObject - the copied object, cannot be null
      toReference - the type description reference to copy source as type to, cannot be null
      context - the copy context, cannot be null
    • createContext

      protected ModelObjectCopier.CopyContext createContext(org.eclipse.emf.ecore.EClass toClass)
      Creates copy context. Subclasses may override and provide more specific copy context.
      Parameters:
      toClass - the result model class, cannot be null
      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 be null
      reference - the reference parent, cannot be null
      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 be null
      targetClass - the result model class, cannot be null
      targetParent - the result model parent, cannot be null
      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 be null
      existingNames - the existing name collection to check for, cannot be null
      copyContext - the copy context to check for, cannot be null
      eClass - the class of the candidate, cannot be null
      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 be null
      targetObject - the target object to copy, cannot be null
      targetParent - the target parent to copy to or null if none
      reference - the parent reference to copy to or null if none
      context - the copy context, cannot be null
      Returns:
      the copied model metadata object name, never null
    • getName

      protected String getName(org.eclipse.emf.ecore.EObject object)
      Returns the name of the provided object or null if it cannot be obtained.
      Parameters:
      object - the model object to get name of, cannot be null
      Returns:
      the name of the provided object or null if 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 be null
      Returns:
      the target feature used to populate a copy instance, or null if 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 be null
      eObject - the original object, cannot be null
      copyObject - the copied object, cannot be null
      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 be null
      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 be null
      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 be null
      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 be null
      reference - the reference to check, cannot be null
      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 be null
      externalProperty - the external property, cannot be null
      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 be null
      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 be null
      toObject - the object to copy to, cannot be null
      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 be null
      reference - the reference to check, cannot be null
      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 be null
      fromFeature - the feature to copy, cannot be null
      toObject - the object to copy feature to, cannot be null
      toFeature - the feature to copy, cannot be null
      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 be null
      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 be null
      fromAttribute - the attribute to copy value from, cannot be null
      fromObject - the object to copy attribute to, cannot be null
      fromAttribute - the attribute to copy value to, cannot be null
      context - the copy context, cannot be null
      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 except producedTypes reference.
      Parameters:
      fromObject - the object to copy containment reference feature from, cannot be null
      fromReference - the containment reference feature to copy, cannot be null
      toObject - the object to copy containment reference feature to, cannot be null
      toReference - the containment reference feature to copy, cannot be null
      context - the copy context, cannot be null
      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 be null
      fromReference - the non-containment reference feature to copy, cannot be null
      toObject - the object to copy non-containment reference feature to, cannot be null
      toReference - the non-containment reference feature to copy, cannot be null
      context - the copy context, cannot be null
      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 returns true.
      Parameters:
      fromObject - the object to copy external property reference feature from, cannot be null
      fromReference - the external property reference feature to copy, cannot be null
      toObject - the object to copy external property reference feature to, cannot be null
      toReference - the external property reference feature to copy, cannot be null
      context - the copy context, cannot be null
      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 of ExternalDataSources and Cubes
      Parameters:
      eObject - the object to copy sub objects from, cannot be null
      copyObject - the object to copy sub objects to, cannot be null
      toReference - the sub objects reference feature to copy, cannot be null
      fromReference - the sub objects reference feature to copy, cannot be null
      context - the copy context, cannot be null