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


Java AddVariableValueAction類代碼示例

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


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

示例1: testSignal

import org.eclipse.uml2.uml.AddVariableValueAction; //導入依賴的package包/類
@Test
public void testSignal() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.signal");
	Signal sig = signal(model, "Sig");
	SignalEvent sigEvent = signalEvent(model, "Sig");
	assertEquals(sig, sigEvent.getSignal());
	Class sigFactory = cls(model, "#Sig_factory");
	Operation sigCtor = operation(sigFactory, "Sig");
	assertEquals(4, sigCtor.getOwnedParameters().size());

	SequenceNode body = loadActionCode(model, "A", "test");
	SequenceNode createNode = node(body, 0, "create Sig", SequenceNode.class);
	CreateObjectAction initiateNode = node(createNode, 0, "instantiate Sig", CreateObjectAction.class);
	assertEquals(sig, initiateNode.getClassifier());
	node(createNode, 1, "#temp=instantiate Sig", AddVariableValueAction.class);
	node(createNode, 2, "1", ValueSpecificationAction.class);
	node(createNode, 3, "true", ValueSpecificationAction.class);
	node(createNode, 4, "\"test\"", ValueSpecificationAction.class);
	node(createNode, 5, "#temp", ReadVariableAction.class);
	CallOperationAction ctorCall = node(createNode, 6, "Sig(Sig p0, Integer p1, Boolean p2, String p3)",
			CallOperationAction.class);
	assertEquals(sigCtor, ctorCall.getOperation());
	node(createNode, 7, "#temp", ReadVariableAction.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:25,代碼來源:TestStructure.java

示例2: buildReturnStatement

import org.eclipse.uml2.uml.AddVariableValueAction; //導入依賴的package包/類
protected void buildReturnStatement(Node node) {
    TemplateableElement bound = (Class) MDDUtil.getNearest(builder.getCurrentActivity(),
            IRepository.PACKAGE.getClass_());
    AddVariableValueAction action = (AddVariableValueAction) builder.createAction(IRepository.PACKAGE
            .getAddVariableValueAction());
    try {
        Variable variable = builder.getReturnValueVariable();
        if (variable == null) {
            problemBuilder.addProblem(new ReturnValueNotExpected(), node);
            throw new AbortedScopeCompilationException();
        }
        final InputPin value = builder.registerInput(action.createValue(null, null));
        node.apply(this);
        action.setVariable(variable);
        TypeUtils.copyType(variable, value, bound);
        fillDebugInfo(action, node);
    } finally {
        builder.closeAction();
    }
    checkIncomings(action, node, getBoundElement());
    ActivityUtils.makeFinal(builder.getCurrentBlock(), action);
}
 
開發者ID:abstratt,項目名稱:textuml,代碼行數:23,代碼來源:BehaviorGenerator.java

示例3: caseAWriteVariableSpecificStatement

import org.eclipse.uml2.uml.AddVariableValueAction; //導入依賴的package包/類
@Override
public void caseAWriteVariableSpecificStatement(AWriteVariableSpecificStatement node) {
    AddVariableValueAction action = (AddVariableValueAction) builder.createAction(IRepository.PACKAGE
            .getAddVariableValueAction());
    action.setIsReplaceAll(true);
    try {
        final InputPin value = builder.registerInput(action.createValue(null, null));
        super.caseAWriteVariableSpecificStatement(node);
        String variableName = TextUMLCore.getSourceMiner().getIdentifier(node.getIdentifier());
        Variable variable = builder.getVariable(variableName);
        if (variable == null) {
            problemBuilder.addError("Unknown local variable '" + variableName + "'", node.getIdentifier());
            throw new AbortedStatementCompilationException();
        }
        action.setVariable(variable);
        if (variable.getType() == null)
            // infer variable type if omitted
            TypeUtils.copyType(ActivityUtils.getSource(value), variable, getBoundElement());
        TypeUtils.copyType(variable, value, getBoundElement());
        fillDebugInfo(action, node);
    } finally {
        builder.closeAction();
    }
    checkIncomings(action, node.getIdentifier(), getBoundElement());
}
 
開發者ID:abstratt,項目名稱:textuml,代碼行數:26,代碼來源:BehaviorGenerator.java

示例4: testPostfixOperation

import org.eclipse.uml2.uml.AddVariableValueAction; //導入依賴的package包/類
@Test
public void testPostfixOperation() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.compound_ops");
	SequenceNode body = loadActionCode(model, "TestClass", "test");
	SequenceNode postStmtNode = (SequenceNode) body.getNode("this.fld=this.fld++;");
	SequenceNode postExprNode = (SequenceNode) postStmtNode.getNode("this.fld=this.fld++");
	node(postExprNode, 0, "this", ReadSelfAction.class);
	node(postExprNode, 1, "this.fld", ReadStructuralFeatureAction.class);
	node(postExprNode, 2, "#temp=this.fld", AddVariableValueAction.class);
	node(postExprNode, 3, "this.fld", ReadStructuralFeatureAction.class);
	node(postExprNode, 4, "1", ValueSpecificationAction.class);
	node(postExprNode, 5, "this.fld++", CallOperationAction.class);
	node(postExprNode, 6, "this.fld=this.fld++", AddStructuralFeatureValueAction.class);
	node(postExprNode, 7, "#temp", ReadVariableAction.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:16,代碼來源:TestActionCode.java

示例5: testCreateActionBehavior

import org.eclipse.uml2.uml.AddVariableValueAction; //導入依賴的package包/類
@Test
public void testCreateActionBehavior() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.create_and_destroy");
	SequenceNode body = loadActionCode(model, "TestClass", "testCreate");
	SequenceNode createNode = (SequenceNode) body.getNode("create TestClass");
	node(createNode, 0, "instantiate TestClass", CreateObjectAction.class);
	node(createNode, 1, "#temp=instantiate TestClass", AddVariableValueAction.class);
	node(createNode, 2, "#temp", ReadVariableAction.class);
	node(createNode, 3, "1", ValueSpecificationAction.class);
	node(createNode, 4, "2", ValueSpecificationAction.class);
	node(createNode, 5, "#temp.TestClass(Integer p0, Integer p1)", CallOperationAction.class);
	node(createNode, 6, "#temp", ReadVariableAction.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:14,代碼來源:TestActionCode.java

示例6: testAutoToString

import org.eclipse.uml2.uml.AddVariableValueAction; //導入依賴的package包/類
@Test
public void testAutoToString() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.toString");

	SequenceNode body = loadActionCode(model, "TestClass", "testAuto");
	node(body, 0, "\"a\"", ValueSpecificationAction.class);
	node(body, 1, "\"a\".toString", CallOperationAction.class);
	node(body, 2, "3", ValueSpecificationAction.class);
	node(body, 3, "3.toString", CallOperationAction.class);
	node(body, 4, "\"a\".toString+3.toString", CallOperationAction.class);
	node(body, 5, "a=\"a\".toString+3.toString", AddVariableValueAction.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:13,代碼來源:TestActionCode.java

示例7: testEquality

import org.eclipse.uml2.uml.AddVariableValueAction; //導入依賴的package包/類
@Test
public void testEquality() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.equalities");

	SequenceNode body = loadActionCode(model, "TestClass", "testEquality");
	node(body, 0, "\"Fdf\"", ValueSpecificationAction.class);
	node(body, 1, "\"Str\"", ValueSpecificationAction.class);
	node(body, 2, "\"Fdf\"==\"Str\"", TestIdentityAction.class);
	node(body, 3, "b=\"Fdf\"==\"Str\"", AddVariableValueAction.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:11,代碼來源:TestActionCode.java

示例8: testInequality

import org.eclipse.uml2.uml.AddVariableValueAction; //導入依賴的package包/類
@Test
public void testInequality() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.equalities");

	SequenceNode body = loadActionCode(model, "TestClass", "testInequality");
	node(body, 0, "\"Fdf\"", ValueSpecificationAction.class);
	node(body, 1, "\"Str\"", ValueSpecificationAction.class);
	node(body, 2, "\"Fdf\"==\"Str\"", TestIdentityAction.class);
	node(body, 3, "!\"Fdf\"==\"Str\"", CallOperationAction.class);
	node(body, 4, "b=!\"Fdf\"==\"Str\"", AddVariableValueAction.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:12,代碼來源:TestActionCode.java

示例9: testForLoop

import org.eclipse.uml2.uml.AddVariableValueAction; //導入依賴的package包/類
@Test
public void testForLoop() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.for_control");
	SequenceNode body = loadActionCode(model, "TestClass", "test");
	LoopNode loopNode = node(body, 0, "for (i<limit) { ... }", LoopNode.class);
	SequenceNode bodyNode = loopBody(loopNode, 0, null, SequenceNode.class);
	node(bodyNode, 0, "this.sum=this.sum+i;", SequenceNode.class);
	SequenceNode increment = loopBody(loopNode, 1, "update", SequenceNode.class);
	node(increment, 0, "i=++i", SequenceNode.class);
	loopCond(loopNode, "i<limit", SequenceNode.class);
	SequenceNode setup = loopSetup(loopNode, "setup", SequenceNode.class);
	node(setup, 0, "0", ValueSpecificationAction.class);
	node(setup, 1, "i=0", AddVariableValueAction.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:15,代碼來源:TestControlStructures.java

示例10: testIf

import org.eclipse.uml2.uml.AddVariableValueAction; //導入依賴的package包/類
@Test
public void testIf() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.if_control");
	SequenceNode body = loadActionCode(model, "TestClass", "testIf");
	SequenceNode ifNode = node(body, 0, "if (test)", SequenceNode.class);
	node(ifNode, 0, "test", ReadVariableAction.class);
	node(ifNode, 1, "#if_cond=test", AddVariableValueAction.class);
	ConditionalNode condNode = node(ifNode, 2, null, ConditionalNode.class);
	clauseTest(condNode, 0, "#if_cond", ReadVariableAction.class);
	SequenceNode clauseBody = clauseBody(condNode, 0, null, SequenceNode.class);
	node(clauseBody, 0, "Action.log(\"then\");", SequenceNode.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:13,代碼來源:TestControlStructures.java

示例11: testIfElse

import org.eclipse.uml2.uml.AddVariableValueAction; //導入依賴的package包/類
@Test
public void testIfElse() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.if_control");
	SequenceNode body = loadActionCode(model, "TestClass", "testIfElse");
	SequenceNode ifNode = node(body, 0, "if (test)", SequenceNode.class);
	node(ifNode, 0, "test", ReadVariableAction.class);
	node(ifNode, 1, "#if_cond=test", AddVariableValueAction.class);
	ConditionalNode condNode = node(ifNode, 2, null, ConditionalNode.class);
	clauseTest(condNode, 0, "#if_cond", ReadVariableAction.class);
	SequenceNode clauseBody = clauseBody(condNode, 0, null, SequenceNode.class);
	node(clauseBody, 0, "Action.log(\"then\");", SequenceNode.class);
	clauseTest(condNode, 1, "!#if_cond", CallOperationAction.class);
	SequenceNode elseBody = clauseBody(condNode, 1, null, SequenceNode.class);
	node(elseBody, 0, "Action.log(\"else\");", SequenceNode.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:16,代碼來源:TestControlStructures.java

示例12: testInlineIf

import org.eclipse.uml2.uml.AddVariableValueAction; //導入依賴的package包/類
@Test
public void testInlineIf() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.if_control");
	SequenceNode body = loadActionCode(model, "TestClass", "testInlineIf");
	SequenceNode ifNode = node(body, 0, "if (test)", SequenceNode.class);
	node(ifNode, 0, "test", ReadVariableAction.class);
	node(ifNode, 1, "#if_cond=test", AddVariableValueAction.class);
	ConditionalNode condNode = node(ifNode, 2, null, ConditionalNode.class);
	clauseTest(condNode, 0, "#if_cond", ReadVariableAction.class);
	clauseBody(condNode, 0, "Action.log(\"then\");", SequenceNode.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:12,代碼來源:TestControlStructures.java

示例13: testInlineIfElse

import org.eclipse.uml2.uml.AddVariableValueAction; //導入依賴的package包/類
@Test
public void testInlineIfElse() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.if_control");
	SequenceNode body = loadActionCode(model, "TestClass", "testInlineIfElse");
	SequenceNode ifNode = node(body, 0, "if (test)", SequenceNode.class);
	node(ifNode, 0, "test", ReadVariableAction.class);
	node(ifNode, 1, "#if_cond=test", AddVariableValueAction.class);
	ConditionalNode condNode = node(ifNode, 2, null, ConditionalNode.class);
	clauseTest(condNode, 0, "#if_cond", ReadVariableAction.class);
	clauseBody(condNode, 0, "Action.log(\"then\");", SequenceNode.class);
	clauseTest(condNode, 1, "!#if_cond", CallOperationAction.class);
	clauseBody(condNode, 1, "Action.log(\"else\");", SequenceNode.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:14,代碼來源:TestControlStructures.java

示例14: checkDefaultCtor

import org.eclipse.uml2.uml.AddVariableValueAction; //導入依賴的package包/類
protected void checkDefaultCtor(SequenceNode body) {
	SequenceNode createNode = (SequenceNode) body.getNode("create DefaultConstructible;");
	SequenceNode createExprNode = (SequenceNode) createNode.getNode("create DefaultConstructible");
	node(createExprNode, 0, "instantiate DefaultConstructible", CreateObjectAction.class);
	node(createExprNode, 1, "#temp=instantiate DefaultConstructible", AddVariableValueAction.class);
	node(createExprNode, 2, "#temp", ReadVariableAction.class);
	node(createExprNode, 3, "#temp.DefaultConstructible()", CallOperationAction.class);
	node(createExprNode, 4, "#temp", ReadVariableAction.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:10,代碼來源:UMLExportTestBase.java

示例15: checkParameteredCtor

import org.eclipse.uml2.uml.AddVariableValueAction; //導入依賴的package包/類
protected void checkParameteredCtor(SequenceNode body) {
	SequenceNode createNode = (SequenceNode) body.getNode("create ClassWithCtors;");
	SequenceNode createExprNode = (SequenceNode) createNode.getNode("create ClassWithCtors");
	node(createExprNode, 0, "instantiate ClassWithCtors", CreateObjectAction.class);
	node(createExprNode, 1, "#temp=instantiate ClassWithCtors", AddVariableValueAction.class);
	node(createExprNode, 2, "#temp", ReadVariableAction.class);
	node(createExprNode, 3, "1", ValueSpecificationAction.class);
	node(createExprNode, 4, "#temp.ClassWithCtors(Integer p0)", CallOperationAction.class);
	node(createExprNode, 5, "#temp", ReadVariableAction.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:11,代碼來源:UMLExportTestBase.java


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