當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。