• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BasicModelExtent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.m2m.qvt.oml.BasicModelExtent的典型用法代码示例。如果您正苦于以下问题:Java BasicModelExtent类的具体用法?Java BasicModelExtent怎么用?Java BasicModelExtent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BasicModelExtent类属于org.eclipse.m2m.qvt.oml包,在下文中一共展示了BasicModelExtent类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: processSourcePair

import org.eclipse.m2m.qvt.oml.BasicModelExtent; //导入依赖的package包/类
private ModelExtent processSourcePair(String metamodel, String model) {
Resource mmRes =
    this.rs.getResource(URI.createFileURI(new File(metamodel).getAbsolutePath()), true);

EObject eObject = mmRes.getContents().get(0);
if (eObject instanceof EPackage) {
    EPackage p = (EPackage)eObject;
    // rs.getPackageRegistry().put(p.getNsURI(), p);
    EPackage.Registry.INSTANCE.put(p.getNsURI(), p);
}

Resource mRes =
    this.rs.getResource(URI.createFileURI(new File(model).getAbsolutePath()), true);

/* TODO: validate model against metamodel */

return new BasicModelExtent(mRes.getContents());
   }
 
开发者ID:mrcalvin,项目名称:qvto-cli,代码行数:19,代码来源:App.java


示例2: arguments

import org.eclipse.m2m.qvt.oml.BasicModelExtent; //导入依赖的package包/类
@Override
protected ModelExtent[] arguments() {
    final ModelExtent psmContents = new BasicModelExtent(theSelectedResource.getContents());
    targetContents = new BasicModelExtent(Collections.<EObject> emptyList());
    targetFolder = theSelectedResource.getURI().trimFileExtension();
    final URI infrastructureTargetFolder = createURI(appendPath(targetFolder, getXmlSchemasFolder()).toString() + "/",
            true);

    final Collection<ModelExtent> modelExtents = new ArrayList<>(6);
    modelExtents.add(psmContents);
    for (final URI infrastructureSchemaLocation : org.search.niem.xsd.library.Activator.INSTANCE
            .getInfrastructureSchemaLocations()) {
        modelExtents.add(new BasicModelExtent(getInfrastructureResource(infrastructureSchemaLocation,
                infrastructureTargetFolder).getContents()));
    }
    modelExtents.add(targetContents);
    return modelExtents.toArray(new ModelExtent[modelExtents.size()]);
}
 
开发者ID:info-sharing-environment,项目名称:NIEM-Modeling-Tool,代码行数:19,代码来源:NIEMpsm2xsdDelegate.java


示例3: createModelExtent

import org.eclipse.m2m.qvt.oml.BasicModelExtent; //导入依赖的package包/类
private static ModelExtent createModelExtent(EObject rootElement) {
    BasicModelExtent modelExtent = new BasicModelExtent();
    if (rootElement != null) {
        modelExtent.add(rootElement);
    }
    return modelExtent;
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:8,代码来源:DomainIndependentTransformationBase.java


示例4: arguments

import org.eclipse.m2m.qvt.oml.BasicModelExtent; //导入依赖的package包/类
@Override
protected final ModelExtent[] arguments() {
    final List<EObject> theCatalogContents = resourceSet.getResource(theSelectedResource.getURI(), true).getContents();
    thePIM = resourceSet.createResource(getThePimUri());
    System.out.println("thePimUri "+getThePimUri());
    final Model theRoot = UMLFactory.eINSTANCE.createModel();
    theRoot.setName("Data");
    // 
    final List<EObject> thePIMContents = thePIM.getContents();
    thePIMContents.add(theRoot);
    thePIMExtent = new BasicModelExtent(thePIMContents);
    return new ModelExtent[] { new BasicModelExtent(theCatalogContents), thePIMExtent };
}
 
开发者ID:GRA-UML,项目名称:tool,代码行数:14,代码来源:GRAsppartifact2modelDelegate.java


示例5: arguments

import org.eclipse.m2m.qvt.oml.BasicModelExtent; //导入依赖的package包/类
@Override
protected ModelExtent[] arguments() {
    final ModelExtent psmContents = new BasicModelExtent(theSelectedResource.getContents());
    targetContents = new BasicModelExtent(Collections.<EObject> emptyList());
    targetFolder = theSelectedResource.getURI().trimFileExtension();
    
    // tjd add gra path to targetFolder
    // tjd TODO: need to support multiple IEPDs and name each one
    //  we could iterate at a higher level and adjust the targetFolder for each iteration
    //  but can not override the final transform of TransformDelegate, so would need to be outside the delegate pattern
    //  in any case, assume the qualifying PSM MPD Model is the name of the IEPD
    org.eclipse.uml2.uml.Package psmIepdModel=getPsmIepdModel();
    String iepdName="IEPD";
    if(psmIepdModel!=null)iepdName=psmIepdModel.getName();
    targetFolder = createURI(appendPath(targetFolder,"artifacts/service model/information model/"+iepdName).toString()+"/",true);
    
    final URI infrastructureTargetFolder = createURI(appendPath(targetFolder, getXmlSchemasFolder()).toString() + "/",
            true);

    final Collection<ModelExtent> modelExtents = new ArrayList<>(6);
    modelExtents.add(psmContents);
    for (final URI infrastructureSchemaLocation : org.ijis.gra.xsd.library.Activator.INSTANCE
            .getInfrastructureSchemaLocations()) {
        modelExtents.add(new BasicModelExtent(getInfrastructureResource(infrastructureSchemaLocation,
                infrastructureTargetFolder).getContents()));
    }
    modelExtents.add(targetContents);
    return modelExtents.toArray(new ModelExtent[modelExtents.size()]);
}
 
开发者ID:GRA-UML,项目名称:tool,代码行数:30,代码来源:NIEMpsm2xsdDelegate.java


示例6: arguments

import org.eclipse.m2m.qvt.oml.BasicModelExtent; //导入依赖的package包/类
@Override
protected final ModelExtent[] arguments() {
	/*
    theTargetContents = new BasicModelExtent(Collections.<EObject> emptyList());
    final ModelExtent targetLocation = new BasicModelExtent(Collections.<EObject> emptyList());
    final List<ModelExtent> arguments = new ArrayList<>(asList(super.arguments()));
    arguments.add(arguments.size() - 1, targetLocation);
    arguments.add(theTargetContents);
    return arguments.toArray(new ModelExtent[arguments.size()]);
    */
    /*
     * in uml:UML,out cat:SPPCAT,out metadata:METADATA,out wsdl:WSDL
     */
    //targetFolder = theSelectedResource.getURI().trimFileExtension();
    targetFolder=GraUtility.getTargeDirectorytURI(theSelectedResource);
    final URI infrastructureTargetFolder = createURI(appendPath(targetFolder, getXmlSchemasFolder()).toString() + "/",
            true);
    
    ModelExtent psmContents = new BasicModelExtent(theSelectedResource.getContents());
    //catTarget = new BasicModelExtent(Collections.<EObject> emptyList());
    //metadataTarget = new BasicModelExtent(Collections.<EObject> emptyList());
    //wsdlTarget = new BasicModelExtent(Collections.<EObject> emptyList());
    annotationTarget = new BasicModelExtent(Collections.<EObject> emptyList());
    final Collection<ModelExtent> modelExtents = new ArrayList<>();
    modelExtents.add(psmContents);
    for (final URI infrastructureSchemaLocation : org.ijis.gra.xsd.library.Activator.INSTANCE
            .getInfrastructureSchemaLocations()) {
        modelExtents.add(new BasicModelExtent(getInfrastructureResource(infrastructureSchemaLocation,
                infrastructureTargetFolder).getContents()));
        break;
    }
    
    //modelExtents.add(catTarget);
    //modelExtents.add(metadataTarget);
    //modelExtents.add(wsdlTarget);// no longer
    modelExtents.add(annotationTarget);
    return modelExtents.toArray(new ModelExtent[modelExtents.size()]);
	
}
 
开发者ID:GRA-UML,项目名称:tool,代码行数:40,代码来源:GraSppModel2artifactDelegate.java


示例7: arguments

import org.eclipse.m2m.qvt.oml.BasicModelExtent; //导入依赖的package包/类
@Override
protected final ModelExtent[] arguments() {
    final List<EObject> theCatalogContents = resourceSet.getResource(theSelectedResource.getURI(), true).getContents();
    thePIM = resourceSet.createResource(getThePimUri());
    final Model theRoot = UMLFactory.eINSTANCE.createModel();
    theRoot.setName("Data");
    final List<EObject> thePIMContents = thePIM.getContents();
    thePIMContents.add(theRoot);
    thePIMExtent = new BasicModelExtent(thePIMContents);
    return new ModelExtent[] { new BasicModelExtent(theCatalogContents), thePIMExtent };
}
 
开发者ID:info-sharing-environment,项目名称:NIEM-Modeling-Tool,代码行数:12,代码来源:NIEMmpdartifact2modelDelegate.java


示例8: createInoutModelsExtentWithInitialContent

import org.eclipse.m2m.qvt.oml.BasicModelExtent; //导入依赖的package包/类
private ModelExtent[] createInoutModelsExtentWithInitialContent(List<EObject>[] inoutModels) {
	ModelExtent[] inoutModelExtent = new ModelExtent[inoutModels.length];
	for (int i = 0; i < inoutModels.length; i++) {
		inoutModelExtent[i] = new BasicModelExtent();
		if (inoutModels[i] != null) {
			ArrayList<EObject> contents = new ArrayList<EObject>();
			contents.addAll(inoutModels[i]);
			inoutModelExtent[i].setContents(contents);
		}
	}
	return inoutModelExtent;
}
 
开发者ID:aciancone,项目名称:klapersuite,代码行数:13,代码来源:QVTOTransformation.java


示例9: createModelExtent

import org.eclipse.m2m.qvt.oml.BasicModelExtent; //导入依赖的package包/类
private ModelExtent createModelExtent(String model) {
	Resource mRes = this.rs.getResource(URI.createFileURI(new File(model).getAbsolutePath()), true);

	return new BasicModelExtent(mRes.getContents());
}
 
开发者ID:georghinkel,项目名称:ttc2017smartGrids,代码行数:6,代码来源:App.java


示例10: runIteration

import org.eclipse.m2m.qvt.oml.BasicModelExtent; //导入依赖的package包/类
private void runIteration(String cim, String cosem, String substation, int index, String changeSet, String runIndex, String phase, TransformationExecutor executor, ExecutionContextImpl context) {

		List<ModelExtent> modelExtents = new ArrayList<ModelExtent>();
		long loadModelsstart = System.nanoTime();
		modelExtents.add(this.createModelExtent(cim));
		if ("outagePrevention".equals(this.transformation)) {
			modelExtents.add(this.createModelExtent(substation));
		}
		modelExtents.add(this.createModelExtent(cosem));
		long loadModelsEnd = System.nanoTime();
		if (phase == "Initial") {
			System.out.println("ModelJoin;" + this.transformation + ";" + changeSet + ";" + runIndex + ";" + Integer.toString(index) + ";" + phase + ";Time;" + Long.toString(loadModelsEnd-loadModelsstart));
		}
		ModelExtent output = new BasicModelExtent();
		modelExtents.add(output);
		modelExtents.add(new BasicModelExtent());

		long start = System.nanoTime();
		ExecutionDiagnostic result = executor.execute(context,
				modelExtents.toArray(new ModelExtent[modelExtents.size()]));
		long end = System.nanoTime();

		if (result.getSeverity() == Diagnostic.OK) {
			// the output objects got captured in the output extent
			XMIResource outResource = (XMIResource) rs
					.createResource(URI.createFileURI(new File(this.transformation + ".xmi").getAbsolutePath()));
			outResource.getContents().addAll(output.getContents());
			try {
				outResource.save(null);
				System.out.println("ModelJoin;" + this.transformation + ";" + changeSet + ";" + runIndex + ";" + Integer.toString(index) + ";" + phase + ";Time;" + Long.toString(end-start));
				System.out.println("ModelJoin;" + this.transformation + ";" + changeSet + ";" + runIndex + ";" + Integer.toString(index) + ";" + phase + ";Elements;" + Integer.toString(outResource.getContents().size()));
			} catch (IOException e) {
				e.printStackTrace();
			}
		} else {
			IStatus status = BasicDiagnostic.toIStatus(result);
			StringBuilder s = new StringBuilder();
			s.append("Failed to execute ");
			s.append(this.transformation);
			s.append(": ");
			s.append(status.getMessage());
			for (IStatus child : status.getChildren()) {
				s.append("\n " + child.getMessage());
			}
			System.err.println(s);
		}
	}
 
开发者ID:georghinkel,项目名称:ttc2017smartGrids,代码行数:48,代码来源:App.java


示例11: build

import org.eclipse.m2m.qvt.oml.BasicModelExtent; //导入依赖的package包/类
public void build() {
      
this.rs.getResourceFactoryRegistry().
    getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl());

this.rs.getResourceFactoryRegistry().
    getExtensionToFactoryMap().put("ecore", new EcoreResourceFactoryImpl());

EPackage.Registry.INSTANCE.put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE); 
Resource.Factory.Registry.INSTANCE.
    getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE); 



List<ModelExtent> modelExtents = new ArrayList<ModelExtent>();

for(int i = 0; i < this.source.size(); i += 2) {
    modelExtents.add(this.processSourcePair(this.source.get(i),this.source.get(i+1)));
}

URI txURI = URI.createFileURI(new File(this.transformation).getAbsolutePath());
TransformationExecutor executor=new TransformationExecutor(txURI);

/* TODO: Does the CLI input match the QVTo transformation (xform) signature? 
   Use TransformationExecutor.loadTransformation() */ 

/* TODO: Put a scheme in place to support different file extensions and 
   use them to identify metamodels?! */




/* TODO: support multiple out parameters for xform */

ModelExtent output = new BasicModelExtent();
modelExtents.add(output);

ExecutionContextImpl context = new ExecutionContextImpl();
context.setConfigProperty("keepModeling", true);

OutputStreamWriter outStream = new OutputStreamWriter(System.out);
Log log = new WriterLog(outStream);
context.setLog(log);

ExecutionDiagnostic result = executor.execute(context,
					      modelExtents.toArray(new ModelExtent[modelExtents.size()]));

if(result.getSeverity() == Diagnostic.OK) {
    // the output objects got captured in the output extent
    UMLResource outResource = (UMLResource) rs.createResource(URI.createFileURI(new File("out.uml").getAbsolutePath()));
    outResource.getContents().addAll(output.getContents());
    try {
	outResource.save(null);
    } catch (IOException e) {
	e.printStackTrace();
    }
} else {
    IStatus status = BasicDiagnostic.toIStatus(result);
    StringBuilder s = new StringBuilder();
    s.append("Failed to execute ");
    s.append(txURI);
    s.append(": ");
    s.append(status.getMessage());
    for (IStatus child : status.getChildren()) {
	s.append("\n " + child.getMessage());
    }
    System.out.println(s);
}
   }
 
开发者ID:mrcalvin,项目名称:qvto-cli,代码行数:70,代码来源:App.java


示例12: testTraceTransformation

import org.eclipse.m2m.qvt.oml.BasicModelExtent; //导入依赖的package包/类
protected void testTraceTransformation(String modelName) throws Exception {
    // test parameters
    URI targetModelURI = createResourceModelURI(testPluginId, modelName + "." + targetFileExtension);
    URI umlModelURI = createResourceModelURI(testPluginId, modelName + ".uml");
    URI sourceModelURI = createResourceModelURI(testPluginId, modelName + "_tmp." + sourceFileExtension);

    /*
     * Run original transformation that yields
     * - the textual model
     * - the trace model to be compared (expected)
     */
    ModelExtent targetModel = createModelExtent(targetModelURI);
    ModelExtent umlModel = createModelExtent(umlModelURI);
    ModelExtent sourceModel = createModelExtent(sourceModelURI);
    Trace target2sourceTraceModel = new Trace(Collections.emptyList());
    runTransformation(targetToSourceTransformationUri, targetModel, umlModel, sourceModel, target2sourceTraceModel);

    /*
     * Run text to graphics transformation that yields
     * - the second graphical model
     * - the t2g trace model (input for trace transformation)
     */
    ModelExtent targetModel2 = new BasicModelExtent();
    Trace source2targetTrace = new Trace(Collections.emptyList());
    runTransformation(sourceToTargetTransformationUri, sourceModel, umlModel, targetModel2, source2targetTrace);

    /*
     * Transform trace model to point to elements of graphicalModel instead of graphicalModel2
     */
    repairTransformationTrace(targetModel, targetModel2, source2targetTrace);

    /*
     * Run trace transformation that yields
     * - the actual trace model to be compared (actual)
     */
    ModelExtent sourceToTargetTraceModel = new BasicModelExtent(source2targetTrace.getTraceContent());
    ModelExtent actualTraceModel = new BasicModelExtent();
    ModelExtent target2sourceTransformationModel = new BasicModelExtent(
            new QVTOResource(targetToSourceTransformationUri, getResourceSet().getPackageRegistry()).getContents());
    runTransformation(sourceToTargetTraceTransformationUri, Arrays.asList(sourceToTargetTraceModel,
            actualTraceModel, targetModel, target2sourceTransformationModel), new Trace(Collections.emptyList()));

    // compare expected and actual
    assertTraceEquals(target2sourceTraceModel, actualTraceModel);
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:46,代码来源:DirectedTraceTransformationTestBase.java


示例13: runTransformation

import org.eclipse.m2m.qvt.oml.BasicModelExtent; //导入依赖的package包/类
protected ModelExtent runTransformation(URI transformationURI, URI sourceModelURI, URI umlModelURI)
        throws IOException {
    return runTransformation(transformationURI, sourceModelURI, umlModelURI, new BasicModelExtent(),
            new Trace(Collections.emptyList()));
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:6,代码来源:PlainTransformationTestBase.java


示例14: createModelExtent

import org.eclipse.m2m.qvt.oml.BasicModelExtent; //导入依赖的package包/类
private static ModelExtent createModelExtent(Resource r) {
    return new BasicModelExtent(r.getContents());
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:4,代码来源:PlainTransformationTestBase.java


示例15: transform

import org.eclipse.m2m.qvt.oml.BasicModelExtent; //导入依赖的package包/类
private static void transform (OperationInterfaceContainer opInterfaceContainer, List<EObject> external, IOverviewConverterCallback callback)
{
			final Overview overviewModel = (Overview)EcoreUtil.getRootContainer(opInterfaceContainer);

               URI transformationURI = URI.createURI("platform:/plugin/eu.cloudscaleproject.env.csm2pcm/transforms/pcm2opInterfaceContainer.qvto");
               final TransformationExecutor executor = new TransformationExecutor(transformationURI);
               executor.loadTransformation();

               final ExecutionContextImpl context = new ExecutionContextImpl();

               
               context.setLog(new TransformationLogger());
               context.setConfigProperty("moduleID", opInterfaceContainer.getId());
               context.setConfigProperty("CSMID", CSM_ID_PREFIX);
               
               context.setConfigProperty("PCM_REPOSITORY_KEY", IOverviewConverter.KEY_PCM_REPOSITORY);
               context.setConfigProperty("PCM_SYSTEM_KEY", IOverviewConverter.KEY_PCM_SYSTEM);
               context.setConfigProperty("PCM_INTERFACE_KEY", IOverviewConverter.KEY_PCM_INTERFACE);
               context.setConfigProperty("PCM_OPERATION_KEY", IOverviewConverter.KEY_PCM_OPERATION);

			//clear interfaces
			OverviewArchitectureUtil.deleteInterfaces(opInterfaceContainer.getProvidedInterfaces());
			OverviewArchitectureUtil.deleteInterfaces(opInterfaceContainer.getRequiredInterfaces());

			List<EObject> inputCsmList = new ArrayList<EObject>();
			inputCsmList.add(overviewModel);
			
			ResourceSet dataSet = new ResourceSetImpl();
			
			//find resource set
			for(EObject eo : external){
				if(eo instanceof Repository){
					
					EcoreUtil.resolveAll(eo);
					
					if(eo.eResource() != null && eo.eResource().getResourceSet() != null){
						dataSet = eo.eResource().getResourceSet();
					}
				}
			}
			
			URI inDataTypeUri = URI.createURI("pathmap://PCM_MODELS/PrimitiveTypes.repository");
			Resource dataTypesResource = dataSet.getResource(inDataTypeUri, true);
			EList<EObject> inObjectsDataTypes = dataTypesResource.getContents();
			
			final ModelExtent inputCsm = new BasicModelExtent(inputCsmList);
			final ModelExtent inputExternal = new BasicModelExtent(external);
			final ModelExtent inputDataTypes = new BasicModelExtent(inObjectsDataTypes);
			
			ExecutionDiagnostic result = executor.execute(context, inputExternal, inputDataTypes, inputCsm);

			if(result.getSeverity() == Diagnostic.OK) {
				try {
					if (overviewModel.eResource() != null)
						overviewModel.eResource().save(null);
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				if(callback != null){
					callback.callback();
				}
			}
			else{
				// turn the result diagnostic into status and send it to error log			
				IStatus status = BasicDiagnostic.toIStatus(result);
				Activator.getDefault().getLog().log(status);
			}
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:70,代码来源:OverviewImport.java


示例16: arguments

import org.eclipse.m2m.qvt.oml.BasicModelExtent; //导入依赖的package包/类
@Override
protected final ModelExtent[] arguments() {
    niemUml = new BasicModelExtent(theSelectedResource.getContents());
    return new ModelExtent[] { niemUml };
}
 
开发者ID:GRA-UML,项目名称:tool,代码行数:6,代码来源:NIEMpim2psmDelegate.java



注:本文中的org.eclipse.m2m.qvt.oml.BasicModelExtent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SchemaDOMParser类代码示例发布时间:2022-05-23
下一篇:
Java HandlerResolverImpl类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap