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


Java EtlModule類代碼示例

本文整理匯總了Java中org.eclipse.epsilon.etl.EtlModule的典型用法代碼示例。如果您正苦於以下問題:Java EtlModule類的具體用法?Java EtlModule怎麽用?Java EtlModule使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: isProperlyContained

import org.eclipse.epsilon.etl.EtlModule; //導入依賴的package包/類
public boolean isProperlyContained()
{
	boolean result = false;
	for(EOLElement de: createdEolElements)
	{
		EOLElement trace = de;
		while(!(de instanceof EtlModule) && trace.getContainer() != null)
		{
			trace = trace.getContainer();
		}
		
		if(trace.equals(this.fetchEtlProgram()))
		{
			result = true;
		}
		else {
			result = false;
			System.err.println("The domElement is: " + trace.getClass());
			break;
		}
	}
	return result;
}
 
開發者ID:epsilonlabs,項目名稱:haetae,代碼行數:24,代碼來源:EtlElementCreatorFactory.java

示例2: parseAST

import org.eclipse.epsilon.etl.EtlModule; //導入依賴的package包/類
public static EOLElement parseAST(String text)
{
	EtlModule etlModule = new EtlModule();
	
	try {
		etlModule.parse(text);
	} catch (Exception e) {
		e.printStackTrace();
		return null;
	}
	
	Ast2EtlContext context = new Ast2EtlContext(etlModule);
	
	EOLElement result = context.getEtlElementCreatorFactory().createEOLElement(etlModule.getAst(), null, context);
	return result;
}
 
開發者ID:epsilonlabs,項目名稱:haetae,代碼行數:17,代碼來源:AST2EtlElementProducer.java

示例3: createModule

import org.eclipse.epsilon.etl.EtlModule; //導入依賴的package包/類
@Override
public IEolExecutableModule createModule() {
	EtlModule module = new EtlModule();
	module.getContext().getNativeTypeDelegates()
			.add(new ExtensionPointToolNativeTypeDelegate());

	return module;
}
 
開發者ID:leondart,項目名稱:FRaMED,代碼行數:9,代碼來源:TransformationExecutor.java

示例4: test

import org.eclipse.epsilon.etl.EtlModule; //導入依賴的package包/類
@Test
public void test() {
	
	URL url = getClass().getResource("test_import.etl");
	System.out.println(url.toString());
	EtlModule etlModule = new EtlModule();
	try {
		etlModule.parse(new File(url.getPath()));
	} catch (Exception e) {
		e.printStackTrace();
	}

	Ast2EtlContext context = new Ast2EtlContext(etlModule);
	
	EOLElement eolElement = context.getEtlElementCreatorFactory().createEOLElement(etlModule.getAst(), null, context);

	assertEquals(eolElement.getClass(), ETLModuleImpl.class);
	
	ETLModule etlProgram = (ETLModule) eolElement;
	assertEquals(etlProgram.getModelDeclarations().size(), 0);
	assertEquals(etlProgram.getPreBlocks().size(), 0);
	assertEquals(etlProgram.getPostBlocks().size(), 0);
	assertEquals(etlProgram.getTransformationRules().size(), 1);
	assertEquals(etlProgram.getOperations().size(), 0);
	
	assertEquals(etlProgram.getImports().size(), 1);
	Import import1 = etlProgram.getImports().get(0);
	assertEquals(import1.getImportedModule().getClass(), EOLModuleImpl.class);
	assertEquals(import1.getImported(), "loadModels.eol");
	
	TransformationRule rule1 = etlProgram.getTransformationRules().get(0);
	assertEquals(rule1.getName().getName(), "A2D");
	assertEquals(rule1.getSource().getName().getName(), "a");
	assertEquals(rule1.getSource().getResolvedType().getClass(), ModelElementTypeImpl.class);
	ModelElementType source1Type = (ModelElementType) rule1.getSource().getResolvedType();
	assertEquals(source1Type.getModelName(), "Source");
	assertEquals(source1Type.getElementName(), "A");
	
	assertEquals(rule1.getTargets().size(), 1);
	FormalParameterExpression rule1target = rule1.getTargets().get(0);
	assertEquals(rule1target.getName().getName(), "e");
	assertEquals(rule1target.getResolvedType().getClass(), ModelElementTypeImpl.class);
	ModelElementType rule1targetType = (ModelElementType) rule1target.getResolvedType();
	assertEquals(rule1targetType.getModelName(), "Target");
	assertEquals(rule1targetType.getElementName(), "E");
	
	ExpressionOrStatementBlock guard = rule1.getGuard();
	assertEquals(guard.getBlock(), null);
	NotEqualsOperatorExpression notEqualsOperatorExpression = (NotEqualsOperatorExpression) guard.getExpression();
	NameExpression conditionLhs = (NameExpression) notEqualsOperatorExpression.getLhs();
	assertEquals(conditionLhs.getName(), "a");
	NameExpression conditionRhs = (NameExpression) notEqualsOperatorExpression.getRhs();
	assertEquals(conditionRhs.getName(), "null");
	
	assertEquals(rule1.getBody().getStatements().size(), 1);
	Statement statement1 = rule1.getBody().getStatements().get(0);
	assertEquals(statement1.getClass(), AssignmentStatementImpl.class);
	AssignmentStatement assignmentStatement = (AssignmentStatement) statement1;
	assertEquals(assignmentStatement.getLhs().getClass(), PropertyCallExpressionImpl.class);
	PropertyCallExpression lhs = (PropertyCallExpression) assignmentStatement.getLhs();
	assertEquals(lhs.getTarget().getClass(), NameExpressionImpl.class);
	NameExpression target = (NameExpression) lhs.getTarget();
	assertEquals(target.getName(), "e");
	NameExpression property = lhs.getProperty();
	assertEquals(property.getName(), "f");
	
	MethodCallExpression rhs = (MethodCallExpression) assignmentStatement.getRhs();
	PropertyCallExpression rhsTarget = (PropertyCallExpression) rhs.getTarget();
	NameExpression rhsTargetTarget = (NameExpression) rhsTarget.getTarget();
	assertEquals(rhsTargetTarget.getName(), "a");
	assertEquals(rhsTarget.getProperty().getName(), "b");
	assertEquals(rhs.getMethod().getName(), "equivalents");
}
 
開發者ID:epsilonlabs,項目名稱:haetae,代碼行數:74,代碼來源:ImportCreatorTest.java

示例5: test1

import org.eclipse.epsilon.etl.EtlModule; //導入依賴的package包/類
@Test
public void test1() {
	
	URL url = getClass().getResource("test_import2.etl");
	System.out.println(url.toString());
	EtlModule etlModule = new EtlModule();
	try {
		etlModule.parse(new File(url.getPath()));
	} catch (Exception e) {
		e.printStackTrace();
	}

	Ast2EtlContext context = new Ast2EtlContext(etlModule);
	
	EOLElement eolElement = context.getEtlElementCreatorFactory().createEOLElement(etlModule.getAst(), null, context);

	assertEquals(eolElement.getClass(), ETLModuleImpl.class);
	
	ETLModule etlProgram = (ETLModule) eolElement;
	assertEquals(etlProgram.getModelDeclarations().size(), 0);
	assertEquals(etlProgram.getPreBlocks().size(), 0);
	assertEquals(etlProgram.getPostBlocks().size(), 0);
	assertEquals(etlProgram.getTransformationRules().size(), 1);
	assertEquals(etlProgram.getOperations().size(), 0);
	
	assertEquals(etlProgram.getImports().size(), 1);
	Import import1 = etlProgram.getImports().get(0);
	assertEquals(import1.getImportedModule().getClass(), ETLModuleImpl.class);
	assertEquals(import1.getImported(), "imported_etl.etl");
	
	TransformationRule rule1 = etlProgram.getTransformationRules().get(0);
	assertEquals(rule1.getName().getName(), "A2D");
	assertEquals(rule1.getSource().getName().getName(), "a");
	assertEquals(rule1.getSource().getResolvedType().getClass(), ModelElementTypeImpl.class);
	ModelElementType source1Type = (ModelElementType) rule1.getSource().getResolvedType();
	assertEquals(source1Type.getModelName(), "Source");
	assertEquals(source1Type.getElementName(), "A");
	
	assertEquals(rule1.getTargets().size(), 1);
	FormalParameterExpression rule1target = rule1.getTargets().get(0);
	assertEquals(rule1target.getName().getName(), "e");
	assertEquals(rule1target.getResolvedType().getClass(), ModelElementTypeImpl.class);
	ModelElementType rule1targetType = (ModelElementType) rule1target.getResolvedType();
	assertEquals(rule1targetType.getModelName(), "Target");
	assertEquals(rule1targetType.getElementName(), "E");
	
	ExpressionOrStatementBlock guard = rule1.getGuard();
	assertEquals(guard.getBlock(), null);
	NotEqualsOperatorExpression notEqualsOperatorExpression = (NotEqualsOperatorExpression) guard.getExpression();
	NameExpression conditionLhs = (NameExpression) notEqualsOperatorExpression.getLhs();
	assertEquals(conditionLhs.getName(), "a");
	NameExpression conditionRhs = (NameExpression) notEqualsOperatorExpression.getRhs();
	assertEquals(conditionRhs.getName(), "null");
	
	assertEquals(rule1.getBody().getStatements().size(), 1);
	Statement statement1 = rule1.getBody().getStatements().get(0);
	assertEquals(statement1.getClass(), AssignmentStatementImpl.class);
	AssignmentStatement assignmentStatement = (AssignmentStatement) statement1;
	assertEquals(assignmentStatement.getLhs().getClass(), PropertyCallExpressionImpl.class);
	PropertyCallExpression lhs = (PropertyCallExpression) assignmentStatement.getLhs();
	assertEquals(lhs.getTarget().getClass(), NameExpressionImpl.class);
	NameExpression target = (NameExpression) lhs.getTarget();
	assertEquals(target.getName(), "e");
	NameExpression property = lhs.getProperty();
	assertEquals(property.getName(), "f");
	
	MethodCallExpression rhs = (MethodCallExpression) assignmentStatement.getRhs();
	PropertyCallExpression rhsTarget = (PropertyCallExpression) rhs.getTarget();
	NameExpression rhsTargetTarget = (NameExpression) rhsTarget.getTarget();
	assertEquals(rhsTargetTarget.getName(), "a");
	assertEquals(rhsTarget.getProperty().getName(), "b");
	assertEquals(rhs.getMethod().getName(), "equivalents");
}
 
開發者ID:epsilonlabs,項目名稱:haetae,代碼行數:74,代碼來源:ImportCreatorTest.java

示例6: createModule

import org.eclipse.epsilon.etl.EtlModule; //導入依賴的package包/類
@Override
public IEolExecutableModule createModule() {
	return new EtlModule();
}
 
開發者ID:djhuistra,項目名稱:UnifyingAttackTrees,代碼行數:5,代碼來源:ATA2UAT.java


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