当前位置: 首页>>代码示例>>Java>>正文


Java TraceFactory类代码示例

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


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

示例1: createStep

import org.eclipse.gemoc.trace.commons.model.trace.TraceFactory; //导入依赖的package包/类
private Step<?> createStep(EObject caller, String className, String methodName) {
	MSE mse = findOrCreateMSE(caller, className, methodName);
	Step<?> result;
	if (traceAddon == null) {
		GenericSequentialStep step = GenerictraceFactory.eINSTANCE.createGenericSequentialStep();
		MSEOccurrence occurrence = null;
		occurrence = TraceFactory.eINSTANCE.createMSEOccurrence();
		step.setMseoccurrence(occurrence);
		occurrence.setMse(mse);
		result = step;
	} else {
		result = traceAddon.getFactory().createStep(mse, new ArrayList<Object>(), new ArrayList<Object>());
	}

	return result;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:17,代码来源:AbstractSequentialExecutionEngine.java

示例2: findOrCreateMSE

import org.eclipse.gemoc.trace.commons.model.trace.TraceFactory; //导入依赖的package包/类
/**
 * Find the MSE element for the triplet caller/className/MethodName in the model of precalculated possible MSE.
 * If it doesn't exist yet, create one and add it to the model.
 * @param caller the caller object
 * @param className the class containing the method
 * @param methodName the name of the method
 * @return the retrieved or created MSE
 */
public final MSE findOrCreateMSE(EObject caller, String className, String methodName) {
	EOperation operation = findOperation(caller, className, methodName);
	// TODO Should be created/loaded before execution by analyzing the
	// model?
	if (_actionModel == null) {
		_actionModel = TraceFactory.eINSTANCE.createMSEModel();
	}

	if (_actionModel != null) {
		for (MSE existingMSE : _actionModel.getOwnedMSEs()) {
			if (existingMSE.getCaller().equals(caller) && ((existingMSE.getAction() != null && existingMSE.getAction().equals(operation)) || (existingMSE.getAction() == null && operation == null))) {
				// no need to create one, we already have it
				return existingMSE;
			}
		}
	}
	// let's create a MSE
	final GenericMSE mse = TraceFactory.eINSTANCE.createGenericMSE();
	mse.setCallerReference(caller);
	mse.setActionReference(operation);
	if (operation != null)
		mse.setName("MSE_" + caller.getClass().getSimpleName() + "_" + operation.getName());
	else
		mse.setName("MSE_" + caller.getClass().getSimpleName() + "_" + methodName);
	// and add it for possible reuse
	if (_actionModel != null) {

		if (_actionModel.eResource() != null) {
			TransactionUtil.getEditingDomain(_actionModel.eResource());
			RecordingCommand command = new RecordingCommand(TransactionUtil.getEditingDomain(_actionModel.eResource()), "Saving new MSE ") {
				@Override
				protected void doExecute() {
					_actionModel.getOwnedMSEs().add(mse);
					try {
						_actionModel.eResource().save(null);
					} catch (IOException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}
			};
			TransactionUtil.getEditingDomain(_actionModel.eResource()).getCommandStack().execute(command);
		}
	} else {
		_actionModel.getOwnedMSEs().add(mse);
	}
	return mse;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:57,代码来源:AbstractSequentialExecutionEngine.java

示例3: TracePackageImpl

import org.eclipse.gemoc.trace.commons.model.trace.TraceFactory; //导入依赖的package包/类
/**
 * Creates an instance of the model <b>Package</b>, registered with
 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
 * package URI value.
 * <p>Note: the correct way to create the package is via the static
 * factory method {@link #init init()}, which also performs
 * initialization of the package, or returns the registered package,
 * if one already exists.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @see org.eclipse.emf.ecore.EPackage.Registry
 * @see org.eclipse.gemoc.trace.commons.model.trace.TracePackage#eNS_URI
 * @see #init()
 * @generated
 */
private TracePackageImpl() {
	super(eNS_URI, TraceFactory.eINSTANCE);
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:19,代码来源:TracePackageImpl.java

示例4: getTraceFactory

import org.eclipse.gemoc.trace.commons.model.trace.TraceFactory; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public TraceFactory getTraceFactory() {
	return (TraceFactory)getEFactoryInstance();
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:9,代码来源:TracePackageImpl.java


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