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


Java ReadStructuralFeatureAction类代码示例

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


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

示例1: getTypeFromSpecialAcivityNode

import org.eclipse.uml2.uml.ReadStructuralFeatureAction; //导入依赖的package包/类
private String getTypeFromSpecialAcivityNode(ActivityNode node) {
	String targetTypeName;
	// because the output pins not count as parent i have to if-else again
	// ...
	if (node.eClass().equals(UMLPackage.Literals.READ_SELF_ACTION)) {
		targetTypeName = getParentClass(node.getActivity()).getName();
	}
	if (node.eClass().equals(UMLPackage.Literals.ADD_STRUCTURAL_FEATURE_VALUE_ACTION)) {
		targetTypeName = getTypeFromInputPin(((AddStructuralFeatureValueAction) node).getObject());
	} else if (node.eClass().equals(UMLPackage.Literals.READ_STRUCTURAL_FEATURE_ACTION)) {
		targetTypeName = getTypeFromInputPin(((ReadStructuralFeatureAction) node).getObject());
	} else if (node.eClass().equals(UMLPackage.Literals.ACTIVITY_PARAMETER_NODE)) {
		targetTypeName = ((ActivityParameterNode) node).getType().getName();
	} else {
		targetTypeName = "UNKNOWN_TARGET_TYPER_NAME";
		// TODO unknown for me, need the model
	}

	return targetTypeName;
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:21,代码来源:ActivityNodeResolver.java

示例2: testPrefixOperation

import org.eclipse.uml2.uml.ReadStructuralFeatureAction; //导入依赖的package包/类
@Test
public void testPrefixOperation() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.compound_ops");
	SequenceNode body = loadActionCode(model, "TestClass", "test");
	SequenceNode preStmtNode = (SequenceNode) body.getNode("this.fld=++this.fld;");
	SequenceNode preExprNode = (SequenceNode) preStmtNode.getNode("this.fld=++this.fld");
	node(preExprNode, 0, "this", ReadSelfAction.class);
	node(preExprNode, 1, "this.fld", ReadStructuralFeatureAction.class);
	node(preExprNode, 2, "1", ValueSpecificationAction.class);
	node(preExprNode, 3, "++this.fld", CallOperationAction.class);
	node(preExprNode, 4, "this.fld=++this.fld", AddStructuralFeatureValueAction.class);
	node(preExprNode, 5, "this.fld", ReadStructuralFeatureAction.class);
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:14,代码来源:TestActionCode.java

示例3: testPostfixOperation

import org.eclipse.uml2.uml.ReadStructuralFeatureAction; //导入依赖的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

示例4: testAssignment

import org.eclipse.uml2.uml.ReadStructuralFeatureAction; //导入依赖的package包/类
@Test
public void testAssignment() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.compound_ops");
	SequenceNode body = loadActionCode(model, "TestClass", "test");
	SequenceNode assignStmtNode = (SequenceNode) body.getNode("this.fld=10;");
	SequenceNode assignExprNode = (SequenceNode) assignStmtNode.getNode("this.fld=10");
	node(assignExprNode, 0, "this", ReadSelfAction.class);
	node(assignExprNode, 1, "this.fld", ReadStructuralFeatureAction.class);
	node(assignExprNode, 2, "10", ValueSpecificationAction.class);
	node(assignExprNode, 3, "this.fld=10", AddStructuralFeatureValueAction.class);
	node(assignExprNode, 4, "this.fld", ReadStructuralFeatureAction.class);
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:13,代码来源:TestActionCode.java

示例5: testCompoundAssignOperation

import org.eclipse.uml2.uml.ReadStructuralFeatureAction; //导入依赖的package包/类
@Test
public void testCompoundAssignOperation() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.compound_ops");
	SequenceNode body = loadActionCode(model, "TestClass", "test");
	SequenceNode compoundStmtNode = (SequenceNode) body.getNode("this.fld=this.fld+10;");
	SequenceNode compoundExprNode = (SequenceNode) compoundStmtNode.getNode("this.fld=this.fld+10");
	node(compoundExprNode, 0, "this", ReadSelfAction.class);
	node(compoundExprNode, 1, "this.fld", ReadStructuralFeatureAction.class);
	node(compoundExprNode, 2, "10", ValueSpecificationAction.class);
	node(compoundExprNode, 3, "this.fld+10", CallOperationAction.class);
	node(compoundExprNode, 4, "this.fld=this.fld+10", AddStructuralFeatureValueAction.class);
	node(compoundExprNode, 5, "this.fld", ReadStructuralFeatureAction.class);
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:14,代码来源:TestActionCode.java

示例6: generateNodesToBeAdded

import org.eclipse.uml2.uml.ReadStructuralFeatureAction; //导入依赖的package包/类
/**
 * Returns the types of nodes that are to be added
 * @return Returns the types of nodes that are to be added
 */
private List<java.lang.Class<? extends Element>> generateNodesToBeAdded() {
	List<java.lang.Class<? extends Element>> nodes = new LinkedList<>(Arrays.asList(
			AcceptEventAction.class,
			Activity.class,
			ActivityFinalNode.class,
			AddStructuralFeatureValueAction.class,
			AddVariableValueAction.class,
			BroadcastSignalAction.class,
			CallBehaviorAction.class, 
			CallOperationAction.class,
			CreateObjectAction.class,
			DecisionNode.class,
			DestroyObjectAction.class,
			FinalNode.class,
			FlowFinalNode.class,
			ForkNode.class,
			InitialNode.class,
			JoinNode.class,
			MergeNode.class,
			OpaqueAction.class,
			ReadSelfAction.class,
			ReadStructuralFeatureAction.class,
			ReadVariableAction.class,
			SendObjectAction.class,
			SendSignalAction.class,
			ValueSpecificationAction.class
		));
	
	if(PreferencesManager.getBoolean(PreferencesManager.ACTIVITY_DIAGRAM_COMMENT_PREF))
		nodes.add(Comment.class);
	
	return nodes;
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:38,代码来源:ActivityDiagramElementsManager.java

示例7: getTargetFromRSFA

import org.eclipse.uml2.uml.ReadStructuralFeatureAction; //导入依赖的package包/类
private String getTargetFromRSFA(ReadStructuralFeatureAction node) {
	String source = node.getStructuralFeature().getName();
	String object = getTargetFromInputPin(node.getObject());
	if (!object.isEmpty()) {
		source = object + ActivityTemplates.accesOperatoForType(getTypeFromInputPin(node.getObject())) + source;
	}
	return source;
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:9,代码来源:ActivityNodeResolver.java

示例8: caseAAttributeIdentifierExpression

import org.eclipse.uml2.uml.ReadStructuralFeatureAction; //导入依赖的package包/类
@Override
public void caseAAttributeIdentifierExpression(AAttributeIdentifierExpression node) {
    ReadStructuralFeatureAction action = (ReadStructuralFeatureAction) builder.createAction(IRepository.PACKAGE
            .getReadStructuralFeatureAction());
    final String attributeIdentifier = TextUMLCore.getSourceMiner().getIdentifier(node.getIdentifier());
    try {
        builder.registerInput(action.createObject(null, null));
        super.caseAAttributeIdentifierExpression(node);
        builder.registerOutput(action.createResult(null, null));
        final ObjectNode source = ActivityUtils.getSource(action.getObject());
        Classifier targetClassifier = (Classifier) TypeUtils.getTargetType(getRepository(), source, true);
        if (targetClassifier == null) {
            problemBuilder.addError("Object type not determined for '"
                    + ((ATarget) node.getTarget()).getOperand().toString().trim() + "'", node.getIdentifier());
            throw new AbortedStatementCompilationException();
        }
        Property attribute = FeatureUtils.findAttribute(targetClassifier, attributeIdentifier, false, true);
        if (attribute == null) {
            problemBuilder.addProblem(new UnknownAttribute(targetClassifier.getName(), attributeIdentifier, false),
                    node.getIdentifier());
            throw new AbortedStatementCompilationException();
        }
        if (attribute.isStatic()) {
            problemBuilder.addError("Non-static attribute expected: '" + attributeIdentifier + "' in '"
                    + targetClassifier.getName() + "'", node.getIdentifier());
            throw new AbortedStatementCompilationException();
        }
        action.setStructuralFeature(attribute);
        action.getObject().setType(source.getType());
        TypeUtils.copyType(attribute, action.getResult(), targetClassifier);
        fillDebugInfo(action, node);
    } finally {
        builder.closeAction();
    }
    checkIncomings(action, node.getIdentifier(), getBoundElement());
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:37,代码来源:BehaviorGenerator.java

示例9: buildReadStaticStructuralFeature

import org.eclipse.uml2.uml.ReadStructuralFeatureAction; //导入依赖的package包/类
private void buildReadStaticStructuralFeature(Classifier targetClassifier, Property attribute,
        AClassAttributeIdentifierExpression node) {
    ReadStructuralFeatureAction action = (ReadStructuralFeatureAction) builder.createAction(IRepository.PACKAGE
            .getReadStructuralFeatureAction());
    try {
        // // according to UML 2.1 §11.1, "(...) The semantics for static
        // features is undefined. (...)"
        // // our intepretation is that they are allowed and the input is a
        // null value spec
        // builder.registerInput(action.createObject(null, null));
        // LiteralNull literalNull = (LiteralNull)
        // currentPackage().createPackagedElement(null,
        // IRepository.PACKAGE.getLiteralNull());
        // buildValueSpecificationAction(literalNull, node);
        builder.registerOutput(action.createResult(null, targetClassifier));
        if (!attribute.isStatic()) {
            problemBuilder.addError("Static attribute expected: '" + attribute.getName() + "' in '"
                    + targetClassifier.getName() + "'", node.getIdentifier());
            throw new AbortedStatementCompilationException();
        }
        action.setStructuralFeature(attribute);
        // action.getObject().setType(targetClassifier);
        TypeUtils.copyType(attribute, action.getResult(), targetClassifier);
        fillDebugInfo(action, node);
    } finally {
        builder.closeAction();
    }
    checkIncomings(action, node.getIdentifier(), getBoundElement());
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:30,代码来源:BehaviorGenerator.java

示例10: createReadStructuralFeatureAction

import org.eclipse.uml2.uml.ReadStructuralFeatureAction; //导入依赖的package包/类
/**
 * 
 * 
 * @return ReadStructuralFeatureAction
 */
public static ReadStructuralFeatureAction createReadStructuralFeatureAction() {
    org.eclipse.uml2.uml.ReadStructuralFeatureAction readStructuralFeatureAction = FACTORY.createReadStructuralFeatureAction();
    readStructuralFeatureAction.setName(UMLMessage.getMessage(UMLMessage.UML_READSTRUCTURALFEATUREACTION));
    return readStructuralFeatureAction;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:11,代码来源:UMLHelper.java

示例11: getTargetFromActivityNode

import org.eclipse.uml2.uml.ReadStructuralFeatureAction; //导入依赖的package包/类
public String getTargetFromActivityNode(ActivityNode node) {
	if(node == null) {
		Logger.sys.error("This should not happen..");
	}

	String source = "UNHANDLED_ACTIVITYNODE";
	if (node.eClass().equals(UMLPackage.Literals.FORK_NODE) || node.eClass().equals(UMLPackage.Literals.JOIN_NODE)
			|| node.eClass().equals(UMLPackage.Literals.DECISION_NODE)) {
		source = getTargetFromActivityNode(node.getIncomings().get(0).getSource());
	} else if (node.eClass().equals(UMLPackage.Literals.ADD_STRUCTURAL_FEATURE_VALUE_ACTION)) {
		source = getTargetFromInputPin(((AddStructuralFeatureValueAction) node).getObject());
	} else if (node.eClass().equals(UMLPackage.Literals.READ_STRUCTURAL_FEATURE_ACTION)) {
		source = getTargetFromRSFA((ReadStructuralFeatureAction) node);
	} else if (node.eClass().equals(UMLPackage.Literals.ACTIVITY_PARAMETER_NODE)) {
		EClass ec = node.getActivity().getOwner().eClass();
		String paramName = ((ActivityParameterNode) node).getParameter().getName();
		if (ec.equals(UMLPackage.Literals.TRANSITION)) {
			source = ActivityTemplates.transitionActionParameter(paramName);
		} else // the parameter is a function parameter
		{
			source = GenerationTemplates.paramName(paramName);
		}

	} else if (node.eClass().equals(UMLPackage.Literals.CREATE_OBJECT_ACTION)) {
		source = objectMap.get(node);
	} else if (node.eClass().equals(UMLPackage.Literals.READ_SELF_ACTION)) {
		source = ActivityTemplates.SelfLiteral;

	} else if (node.eClass().equals(UMLPackage.Literals.READ_LINK_ACTION)) {
		source = getTargetFromActivityNode(((ReadLinkAction) node).getResult());

	} else if (node.eClass().equals(UMLPackage.Literals.OUTPUT_PIN)) {
		OutputPin outPin = (OutputPin) node;
		source = tempVariableExporter.isOutExported(outPin) ? 
				tempVariableExporter.getRealVariableName(outPin):
				 getTargetFromActivityNode((ActivityNode) node.getOwner());

	} else if (node.eClass().equals(UMLPackage.Literals.VALUE_SPECIFICATION_ACTION)) {
		source = getValueFromValueSpecification(((ValueSpecificationAction) node).getValue());
	} else if (node.eClass().equals(UMLPackage.Literals.READ_VARIABLE_ACTION)) {

		ReadVariableAction rA = (ReadVariableAction) node;
		userVariableExporter.modifyVariableInfo(rA.getVariable());
		source = userVariableExporter.getRealVariableName(rA.getVariable());
	} else if (node.eClass().equals(UMLPackage.Literals.SEQUENCE_NODE)) {
		SequenceNode seqNode = (SequenceNode) node;
		int lastIndex = seqNode.getNodes().size() - 1;
		source = getTargetFromActivityNode(seqNode.getNodes().get(lastIndex));

	} else if (node.eClass().equals(UMLPackage.Literals.CALL_OPERATION_ACTION)) {
		CallOperationAction callAction = (CallOperationAction) node;
		source = tempVariableExporter.getRealVariableName(returnOutputsToCallActions.get(callAction));
	} else {
		Logger.sys.error("Unhandled activity node: " + node.getName());
	}
	return source;
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:58,代码来源:ActivityNodeResolver.java


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