本文整理汇总了Java中org.eclipse.emf.ecore.util.BasicExtendedMetaData.EClassifierExtendedMetaData类的典型用法代码示例。如果您正苦于以下问题:Java EClassifierExtendedMetaData类的具体用法?Java EClassifierExtendedMetaData怎么用?Java EClassifierExtendedMetaData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EClassifierExtendedMetaData类属于org.eclipse.emf.ecore.util.BasicExtendedMetaData包,在下文中一共展示了EClassifierExtendedMetaData类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runCAML2TOSCATypes
import org.eclipse.emf.ecore.util.BasicExtendedMetaData.EClassifierExtendedMetaData; //导入依赖的package包/类
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());
}
示例2: runCAML2TOSCATemplates
import org.eclipse.emf.ecore.util.BasicExtendedMetaData.EClassifierExtendedMetaData; //导入依赖的package包/类
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());
}
示例3: setExtendedMetaData
import org.eclipse.emf.ecore.util.BasicExtendedMetaData.EClassifierExtendedMetaData; //导入依赖的package包/类
@Override
public void setExtendedMetaData(
EClassifierExtendedMetaData eClassifierExtendedMetaData) {
// TODO Auto-generated method stub
}
示例4: getExtendedMetaData
import org.eclipse.emf.ecore.util.BasicExtendedMetaData.EClassifierExtendedMetaData; //导入依赖的package包/类
@Override
public EClassifierExtendedMetaData getExtendedMetaData() {
// TODO Auto-generated method stub
return null;
}
示例5: getExtendedMetaData
import org.eclipse.emf.ecore.util.BasicExtendedMetaData.EClassifierExtendedMetaData; //导入依赖的package包/类
@Override
public EClassifierExtendedMetaData getExtendedMetaData() {
return eClassifierExtendedMetaData;
}
示例6: setExtendedMetaData
import org.eclipse.emf.ecore.util.BasicExtendedMetaData.EClassifierExtendedMetaData; //导入依赖的package包/类
@Override
public void setExtendedMetaData(EClassifierExtendedMetaData eClassifierExtendedMetaData) {
this.eClassifierExtendedMetaData = eClassifierExtendedMetaData;
}