Java 类org.eclipse.emf.ecore.util.BasicExtendedMetaData.EClassifierExtendedMetaData 实例源码

项目:caml2tosca    文件:CAML2TOSCALauncher.java   
public void runCAML2TOSCATypes(URI camlProfile, String toscaModelPath) throws IOException {
        ExecEnv env = EmftvmFactory.eINSTANCE.createExecEnv();

        ResourceSet rs = new ResourceSetImpl();     
        rs.getPackageRegistry().put(ToscaPackage.eINSTANCE.getNsURI(), ToscaPackage.eINSTANCE);
        rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put("ecore", new XMIResourceFactoryImpl());
        rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put("genmodel", new XMIResourceFactoryImpl());
        rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xsd", new XMLResourceFactoryImpl());

        rs.getPackageRegistry().put(UMLPackage.eINSTANCE.getNsURI(),
                UMLPackage.eINSTANCE);
        rs.getResourceFactoryRegistry().getExtensionToFactoryMap()
                .put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE); 

        ToscaUtil.init(rs, "model/");

        // TODO: Maybe there is a better solution for 'resetting' the extended metadata
        // We changed the annotation already in the tosca.ecore
        EClassifierExtendedMetaData.Holder holder = (EClassifierExtendedMetaData.Holder)ToscaPackage.eINSTANCE.getDefinitionsType();
        EClassifierExtendedMetaData result = holder.getExtendedMetaData();
        result.setName("Definitions");

        // Load metamodels
        Metamodel umlMM = EmftvmFactory.eINSTANCE.createMetamodel();
        umlMM.setResource(rs.getResource(URI.createURI("http://www.eclipse.org/uml2/4.0.0/UML"), true));
        env.registerMetaModel("UMLMM", umlMM);

        Metamodel toscaMM = EmftvmFactory.eINSTANCE.createMetamodel();
        toscaMM.setResource(rs.getResource(URI.createURI("http://docs.oasis-open.org/tosca/ns/2011/12"), true));
        env.registerMetaModel("TOSCA", toscaMM);

        //  ##### INPUT Models #####

        // the CAML library
        Model cL = EmftvmFactory.eINSTANCE.createModel();
        URI libraryURI = URI.createPlatformPluginURI("eu.artist.migration.caml", true);
        libraryURI = libraryURI.appendSegments(new String[]{"umllibraries", "CAMLLibrary.uml"});
        cL.setResource(rs.getResource(libraryURI, true));
        env.registerInputModel("CL", cL);

        // the CAML profile 
        Model cP = EmftvmFactory.eINSTANCE.createModel();       
        cP.setResource(rs.getResource(camlProfile, true));
        env.registerInputModel("CP", cP);

//      Model cCP = EmftvmFactory.eINSTANCE.createModel();
//      profileURI = URI.createPlatformPluginURI("eu.artist.migration.caml", true);
//      profileURI = profileURI.appendSegments(new String[]{"umlprofiles", "CommonCloudProfile.profile.uml"});
//      cCP.setResource(rs.getResource(profileURI, true));
//      env.registerInputModel("CCP", cCP);

        // ##### OUTPUT Modles ##### 

        // the TOSCA deployment model
        Model toscaM = EmftvmFactory.eINSTANCE.createModel();
        toscaM.setResource(rs.createResource(URI.createFileURI(new File(toscaModelPath).getAbsolutePath())));
        env.registerOutputModel("TM", toscaM);

        // Load and run module
        DefaultModuleResolver mr = new DefaultModuleResolver(moduleLocation, new ResourceSetImpl());
        TimingData td = new TimingData();
        env.loadModule(mr, typesTrafo);
        td.finishLoading();
        env.run(td);
        td.finish();


        toscaM.getResource().save(Collections.emptyMap());
    }
项目:caml2tosca    文件:CAML2TOSCALauncher.java   
public void runCAML2TOSCATemplates(String camlModelPath, String toscaModelPath) throws IOException {
        ExecEnv env = EmftvmFactory.eINSTANCE.createExecEnv();

        ResourceSet rs = new ResourceSetImpl();
        rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put("ecore", new XMIResourceFactoryImpl());
        rs.getPackageRegistry().put(ToscaPackage.eINSTANCE.getNsURI(), ToscaPackage.eINSTANCE);
        rs.getPackageRegistry().put(UMLPackage.eINSTANCE.getNsURI(),
                UMLPackage.eINSTANCE);
        rs.getResourceFactoryRegistry().getExtensionToFactoryMap()
                .put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE); 
        ToscaUtil.init(rs, "model/");

        // TODO: Maybe there is a better solution for 'resetting' the extended metadata
        // We changed the annotation already in the tosca.ecore
        EClassifierExtendedMetaData.Holder holder = (EClassifierExtendedMetaData.Holder)ToscaPackage.eINSTANCE.getDefinitionsType();
        EClassifierExtendedMetaData result = holder.getExtendedMetaData();
        result.setName("Definitions");

        // Load metamodels
        Metamodel umlMM = EmftvmFactory.eINSTANCE.createMetamodel();
        umlMM.setResource(rs.getResource(URI.createURI("http://www.eclipse.org/uml2/4.0.0/UML"), true));
        env.registerMetaModel("UMLMM", umlMM);

        Metamodel toscaMM = EmftvmFactory.eINSTANCE.createMetamodel();
        toscaMM.setResource(rs.getResource(URI.createURI("http://docs.oasis-open.org/tosca/ns/2011/12"), true));
        env.registerMetaModel("TOSCA", toscaMM);

        //  ##### INPUT Models #####

        // the CAML deployment model
        Model umlM = EmftvmFactory.eINSTANCE.createModel();
        // umlM.setResource(rs.getResource(URI.createURI(camlModelPath, true), true));
        umlM.setResource(rs.getResource(URI.createFileURI(new File(camlModelPath).getAbsolutePath()), true));
        env.registerInputModel("UMLM", umlM);

        // the CAML library
        Model cL = EmftvmFactory.eINSTANCE.createModel();
        URI libraryURI = URI.createPlatformPluginURI("eu.artist.migration.caml", true);
        libraryURI = libraryURI.appendSegments(new String[]{"umllibraries", "CAMLLibrary.uml"});
        cL.setResource(rs.getResource(libraryURI, true));
        env.registerInputModel("CL", cL);

        // the CAML platfrom library
//      Model cPL = EmftvmFactory.eINSTANCE.createModel();
//      libraryURI = URI.createPlatformPluginURI("eu.artist.migration.caml.operatingenvironments", true);
//      libraryURI = libraryURI.appendSegments(new String[]{"umllibraries", "webOperatingEnvironment.uml"});
//      cPL.setResource(rs.getResource(libraryURI, true));
//      env.registerInputModel("CPL", cPL);

        // the CAML profile 
        Model cP = EmftvmFactory.eINSTANCE.createModel();
        URI profileURI = URI.createPlatformPluginURI("eu.artist.migration.caml", true);
        // profileURI = profileURI.appendSegments(new String[]{"umlprofiles", "GoogleAppEngineProfile.profile.uml"});
        // profileURI = profileURI.appendSegments(new String[]{"umlprofiles", "AmazonAWSProfile.profile.uml"});
        profileURI = profileURI.appendSegments(new String[]{"umlprofiles", "OpenStackProfile.profile.uml"});
        cP.setResource(rs.getResource(profileURI, true));
        env.registerInputModel("CP", cP);

        Model cCP = EmftvmFactory.eINSTANCE.createModel();
        profileURI = URI.createPlatformPluginURI("eu.artist.migration.caml", true);
        profileURI = profileURI.appendSegments(new String[]{"umlprofiles", "CommonCloudProfile.profile.uml"});
        cCP.setResource(rs.getResource(profileURI, true));
        env.registerInputModel("CCP", cCP);

        // ##### OUTPUT Modles ##### 

        // the TOSCA deployment model
        Model toscaM = EmftvmFactory.eINSTANCE.createModel();
        toscaM.setResource(rs.createResource(URI.createFileURI(new File(toscaModelPath).getAbsolutePath())));
        env.registerOutputModel("TM", toscaM);

        // Load and run module
        DefaultModuleResolver mr = new DefaultModuleResolver(moduleLocation, new ResourceSetImpl());
        TimingData td = new TimingData();
        env.loadModule(mr, templatesTrafo);
        td.finishLoading();
        env.run(td);
        td.finish();

        toscaM.getResource().save(Collections.emptyMap());
    }
项目:EMFtoCSP    文件:EClassifierAdapter.java   
@Override
public void setExtendedMetaData(
        EClassifierExtendedMetaData eClassifierExtendedMetaData) {
    // TODO Auto-generated method stub

}
项目:EMFtoCSP    文件:EClassifierAdapter.java   
@Override
public EClassifierExtendedMetaData getExtendedMetaData() {
    // TODO Auto-generated method stub
    return null;
}
项目:EMFtoCSP    文件:EClassAdapter.java   
@Override
public void setExtendedMetaData(
        EClassifierExtendedMetaData eClassifierExtendedMetaData) {
    // TODO Auto-generated method stub

}
项目:EMFtoCSP    文件:EClassAdapter.java   
@Override
public EClassifierExtendedMetaData getExtendedMetaData() {
    // TODO Auto-generated method stub
    return null;
}
项目:emfviews    文件:VirtualEClass.java   
@Override
public EClassifierExtendedMetaData getExtendedMetaData() {
  return eClassifierExtendedMetaData;
}
项目:emfviews    文件:VirtualEClass.java   
@Override
public void setExtendedMetaData(EClassifierExtendedMetaData eClassifierExtendedMetaData) {
  this.eClassifierExtendedMetaData = eClassifierExtendedMetaData;
}