Interface IModelObjectCopySupport


  • public interface IModelObjectCopySupport
    Support service to copy and attach 1C:Enterprise model objects. IModelObjectCopySupport instance is stateless and thread-safe. Examples of usage:
     // 1
     // copy catalog and document as catalogs to the target configuration
     modelObjectCopySupport.copyAndAttach(Arrays.asList(catalog, document), configuration,
         MdClassPackage.Literals.CONFIGURATION__CATALOGS, monitor);
    
     // 2
     // copy catalog and document as same types to the target project
     modelObjectCopySupport.copyAndAttach(Arrays.asList(catalog, document), configurationProject, null);
    
     // 3
     // copy report and data processor to the external objects project; they
     // will be  externalized to external report and external data processor
     modelObjectCopySupport.copyAndAttach(Arrays.asList(report, dataProcessor), externalObjectsProject, monitor);
    
     // 4
     // copy external report and external data processor to the configuration
     // project; they will be itnernalized to simple report and data processor
     modelObjectCopySupport.copyAndAttach(Arrays.asList(externalReport, externalDataProcessor),
         configurationProject, null);
     

    To customize copy process clients may extend and use copier classes directly.

    See Also:
    ModelObjectCopier, AttachingModelObjectCopier
    Restriction:
    This interface is not intended to be extended by clients.
    Restriction:
    This interface is not intended to be implemented by clients.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      List<org.eclipse.emf.ecore.EObject> copyAndAttach​(List<? extends org.eclipse.emf.ecore.EObject> objects, org.eclipse.emf.ecore.EObject targetParent, org.eclipse.emf.ecore.EReference reference, org.eclipse.core.runtime.IProgressMonitor monitor)
      Copies the provided objects and attaches them to the provided parent reference feature.
      <T extends MdObject>
      List<T>
      copyAndAttach​(List<T> topObjects, org.eclipse.core.resources.IProject target, org.eclipse.core.runtime.IProgressMonitor monitor)
      Copies the provided top object and attaches it to the target project.
      org.eclipse.emf.ecore.EObject copyAndAttach​(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EObject targetParent, org.eclipse.emf.ecore.EReference reference, org.eclipse.core.runtime.IProgressMonitor monitor)
      Copies the provided object and attaches it to the provided parent reference feature.
      <T extends MdObject>
      T
      copyAndAttach​(T topObject, org.eclipse.core.resources.IProject target, org.eclipse.core.runtime.IProgressMonitor monitor)
      Copies the provided top objects and attaches to the target project.
    • Method Detail

      • copyAndAttach

        org.eclipse.emf.ecore.EObject copyAndAttach​(org.eclipse.emf.ecore.EObject object,
                                                    org.eclipse.emf.ecore.EObject targetParent,
                                                    org.eclipse.emf.ecore.EReference reference,
                                                    org.eclipse.core.runtime.IProgressMonitor monitor)
                                             throws org.eclipse.core.runtime.CoreException
        Copies the provided object and attaches it to the provided parent reference feature. Type of the copied object will be equal to the referenced type of the target parent reference.
        Parameters:
        object - the object to attach to the target parent and reference
        targetParent - the target parent to copy and attach objects to, cannot be null
        reference - the reference to attach objects to, cannot be null
        monitor - the progress monitor to report progress and check cancellation status, or null if progress reporting is not desired
        Returns:
        an attached object copy, never null
        Throws:
        org.eclipse.core.runtime.CoreException - if copy or attach error occurred
      • copyAndAttach

        List<org.eclipse.emf.ecore.EObject> copyAndAttach​(List<? extends org.eclipse.emf.ecore.EObject> objects,
                                                          org.eclipse.emf.ecore.EObject targetParent,
                                                          org.eclipse.emf.ecore.EReference reference,
                                                          org.eclipse.core.runtime.IProgressMonitor monitor)
                                                   throws org.eclipse.core.runtime.CoreException
        Copies the provided objects and attaches them to the provided parent reference feature. Type of the copied objects will be equal to the referenced type of the target parent reference.
        Parameters:
        objects - the objects to attach to the target parent and reference, if reference type is not a collection then objects must have size 1
        targetParent - the target parent to copy and attach objects to, cannot be null
        reference - the reference to attach objects to, cannot be null
        monitor - the progress monitor to report progress and check cancellation status, or null if progress reporting is not desired
        Returns:
        a list of object copies in the same order as objects are provided
        Throws:
        org.eclipse.core.runtime.CoreException - if copy or attach error occurred
      • copyAndAttach

        <T extends MdObject> T copyAndAttach​(T topObject,
                                             org.eclipse.core.resources.IProject target,
                                             org.eclipse.core.runtime.IProgressMonitor monitor)
                                      throws org.eclipse.core.runtime.CoreException
        Copies the provided top objects and attaches to the target project. Type of the copied objects will be the same as the provided. The method supports external object projects and will cast types of attached objects appropriately.
        Parameters:
        topObjects - the top objects copy and to attach, cannot be null
        target - the target project to attach the provided top objects to, cannot be null
        monitor - the progress monitor to report progress and check cancellation status, or null if progress reporting is not desired
        Returns:
        a list of object copies in the same order as topObjects are provided
        Throws:
        org.eclipse.core.runtime.CoreException - if copy or attach error occurred
      • copyAndAttach

        <T extends MdObjectList<T> copyAndAttach​(List<T> topObjects,
                                                   org.eclipse.core.resources.IProject target,
                                                   org.eclipse.core.runtime.IProgressMonitor monitor)
                                            throws org.eclipse.core.runtime.CoreException
        Copies the provided top object and attaches it to the target project. Type of the copied object will be the same as the provided. The method supports external object projects and will cast types of attached objects appropriately.
        Parameters:
        topObject - the top object to copy and attach, cannot be null
        target - the target project to attach the provided top object to, cannot be null
        monitor - the progress monitor to report progress and check cancellation status, or null if progress reporting is not desired
        Returns:
        an attached object copy, never null
        Throws:
        org.eclipse.core.runtime.CoreException - if copy or attach error occurred