當前位置: 首頁>>代碼示例>>Java>>正文


Java AtlParser.inject方法代碼示例

本文整理匯總了Java中org.eclipse.m2m.atl.engine.parser.AtlParser.inject方法的典型用法代碼示例。如果您正苦於以下問題:Java AtlParser.inject方法的具體用法?Java AtlParser.inject怎麽用?Java AtlParser.inject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.m2m.atl.engine.parser.AtlParser的用法示例。


在下文中一共展示了AtlParser.inject方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: loadTransformationModel

import org.eclipse.m2m.atl.engine.parser.AtlParser; //導入方法依賴的package包/類
/**
	 * It loads a transformation as a model.
	 * @param atlTransformationFile 
	 * @return transformation model
	 * @throws ATLCoreException
	 */
	private EMFModel loadTransformationModel (String atlTransformationFile) throws ATLCoreException {
		ModelFactory      modelFactory = new EMFModelFactory();
		EMFReferenceModel atlMetamodel = (EMFReferenceModel)modelFactory.getBuiltInResource("ATL.ecore");
		AtlParser         atlParser    = new AtlParser();		
		EMFModel          atlModel     = (EMFModel)modelFactory.newModel(atlMetamodel);
		atlParser.inject (atlModel, atlTransformationFile);	
		atlModel.setIsTarget(true);				
		
//		// Should we want to serialize the model.
//		String injectedFile = "file:/" + atlTransformationFile + ".xmi";
//		IExtractor extractor = new EMFExtractor();
//		extractor.extract(atlModel, injectedFile);
		
		return atlModel;
	}
 
開發者ID:anatlyzer,項目名稱:anatlyzer,代碼行數:22,代碼來源:Tester.java

示例2: typing

import org.eclipse.m2m.atl.engine.parser.AtlParser; //導入方法依賴的package包/類
public void typing(String atlTransformationFile, Object[] metamodels, String[] names) throws Exception {
	this.atlTransformationFile = atlTransformationFile;

	long diffs = 0;

	AtlParser atlParser = new AtlParser();
	ModelFactory modelFactory = new EMFModelFactory();
	IReferenceModel atlMetamodel = modelFactory
			.getBuiltInResource("ATL.ecore");
	EMFModel atlModel = (EMFModel) modelFactory.newModel(atlMetamodel);

	atlParser.inject(atlModel, atlTransformationFile);

	this.mm = loadMetamodels(metamodels, names);
	this.atlTransformation = new ATLModel(atlModel.getResource(), atlTransformationFile);
	this.analyser = new Analyser(mm, atlTransformation);

	long initTime = System.currentTimeMillis();
	analyser.perform();
	analysisData = new AnalysisResult(analyser);
	
	long finishTime = System.currentTimeMillis();
	diffs += (finishTime - initTime);
	// }
	System.out.println("Time: " + (diffs / 1000.0));
}
 
開發者ID:anatlyzer,項目名稱:anatlyzer,代碼行數:27,代碼來源:BaseTest.java

示例3: loadAtlTransformation

import org.eclipse.m2m.atl.engine.parser.AtlParser; //導入方法依賴的package包/類
private Resource loadAtlTransformation() {
	ModelFactory modelFactory = new EMFModelFactory();

	IReferenceModel atlMetamodel;
	try {
		atlMetamodel = modelFactory.getBuiltInResource("ATL.ecore");
		EMFModel loadedAtlModel = (EMFModel) modelFactory
				.newModel(atlMetamodel);

		AtlParser atlParser = new AtlParser();

		String srcFile = original.getTemplate();
		String anURI   = filePathResolver.resolveTransformation(component, srcFile);
				
		
		atlParser.inject(loadedAtlModel, anURI); 
				//filePathResolver.resolve(srcFile));

		loadedAtlModel.setIsTarget(true);
		return loadedAtlModel.getResource();
	} catch ( ATLCoreException e ) {
		throw new RuntimeException(e);
	}
}
 
開發者ID:jesusc,項目名稱:bento,代碼行數:25,代碼來源:AtlMemoryTemplate.java

示例4: load

import org.eclipse.m2m.atl.engine.parser.AtlParser; //導入方法依賴的package包/類
public static Resource load(String fname) throws ATLCoreException {
	AtlParser atlParser = new AtlParser();
	ModelFactory modelFactory = new EMFModelFactory();
	IReferenceModel atlMetamodel = modelFactory.getBuiltInResource("ATL.ecore");
	EMFModel atlDynModel = (EMFModel) modelFactory.newModel(atlMetamodel);
	atlParser.inject(atlDynModel, fname);
	
	
	Resource originalTrafo = atlDynModel.getResource();
	return originalTrafo;
}
 
開發者ID:anatlyzer,項目名稱:anatlyzer,代碼行數:12,代碼來源:AtlLoader.java

示例5: run

import org.eclipse.m2m.atl.engine.parser.AtlParser; //導入方法依賴的package包/類
/**
 * @see IActionDelegate#run(IAction)
 */
public void run(IAction action) {	
	IFile f = (IFile) ((IStructuredSelection) selection).getFirstElement();
	//ResourceSet rs = new ResourceSetImpl();
	//Resource r = rs.getResource(URI.createPlatformResourceURI(f.getFullPath().toPortableString(), true), true);

	ModelFactory modelFactory = new EMFModelFactory();
	
	IReferenceModel atlMetamodel;
	try {
		atlMetamodel = modelFactory.getBuiltInResource("ATL.ecore");
		IModel atlModel = modelFactory.newModel(atlMetamodel);
		AtlParser atlParser = new AtlParser();
		
		String srcFile = f.getLocation().toPortableString();
		atlParser.inject(atlModel, srcFile);
		
		atlModel.setIsTarget(true);
		
		String injectedFile = "file:/" + srcFile + ".xmi";
		IExtractor extractor = new EMFExtractor();
		extractor.extract(atlModel, injectedFile);
	} catch (ATLCoreException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	} //$NON-NLS-1$

	
}
 
開發者ID:jesusc,項目名稱:bento,代碼行數:32,代碼來源:ExportAtlXMI.java


注:本文中的org.eclipse.m2m.atl.engine.parser.AtlParser.inject方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。