本文整理汇总了Java中org.eclipse.uml2.uml.OutputPin类的典型用法代码示例。如果您正苦于以下问题:Java OutputPin类的具体用法?Java OutputPin怎么用?Java OutputPin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OutputPin类属于org.eclipse.uml2.uml包,在下文中一共展示了OutputPin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.eclipse.uml2.uml.OutputPin; //导入依赖的package包/类
private void init() {
createdClassDependencies = new LinkedList<String>();
tempVariableExporter = new OutVariableExporter();
userVariableExporter = new UserVariableExporter();
returnOutputsToCallActions = new HashMap<CallOperationAction, OutputPin>();
objectMap = new HashMap<CreateObjectAction, String>();
activityExportResolver = new ActivityNodeResolver(objectMap, returnOutputsToCallActions, tempVariableExporter,
userVariableExporter);
returnNodeExporter = new ReturnNodeExporter(activityExportResolver);
callOperationExporter = new CallOperationExporter(tempVariableExporter, returnOutputsToCallActions,
activityExportResolver);
linkActionExporter = new LinkActionExporter(tempVariableExporter, activityExportResolver);
objectActionExporter = new ObjectActionExporter(tempVariableExporter, objectMap, activityExportResolver,
createdClassDependencies);
controlNodeExporter = new StructuredControlNodeExporter(this, activityExportResolver, userVariableExporter,
returnNodeExporter);
}
示例2: caseAExtentIdentifierExpression
import org.eclipse.uml2.uml.OutputPin; //导入依赖的package包/类
@Override
public void caseAExtentIdentifierExpression(AExtentIdentifierExpression node) {
String classifierName = TextUMLCore.getSourceMiner().getQualifiedIdentifier(node.getMinimalTypeIdentifier());
final Classifier classifier = (Classifier) getRepository().findNamedElement(classifierName,
IRepository.PACKAGE.getClassifier(), namespaceTracker.currentPackage());
if (classifier == null) {
problemBuilder.addError("Unknown classifier '" + classifierName + "'", node.getMinimalTypeIdentifier());
throw new AbortedStatementCompilationException();
}
ReadExtentAction action = (ReadExtentAction) builder.createAction(IRepository.PACKAGE.getReadExtentAction());
try {
action.setClassifier(classifier);
final OutputPin result = action.createResult(null, classifier);
result.setUpperValue(MDDUtil.createLiteralUnlimitedNatural(namespaceTracker.currentPackage(),
LiteralUnlimitedNatural.UNLIMITED));
result.setIsUnique(true);
builder.registerOutput(result);
fillDebugInfo(action, node);
} finally {
builder.closeAction();
}
}
示例3: caseAEmptySet
import org.eclipse.uml2.uml.OutputPin; //导入依赖的package包/类
@Override
public void caseAEmptySet(AEmptySet node) {
final ValueSpecificationAction action = (ValueSpecificationAction) builder.createAction(IRepository.PACKAGE
.getValueSpecificationAction());
String qualifiedIdentifier = TextUMLCore.getSourceMiner().getQualifiedIdentifier(
node.getMinimalTypeIdentifier());
Classifier classifier = (Classifier) getRepository().findNamedElement(qualifiedIdentifier,
IRepository.PACKAGE.getClassifier(), namespaceTracker.currentPackage());
if (classifier == null) {
problemBuilder.addProblem(new UnknownType(qualifiedIdentifier), node.getMinimalTypeIdentifier());
throw new AbortedStatementCompilationException();
}
try {
action.setValue(MDDUtil.createLiteralNull(namespaceTracker.currentPackage()));
OutputPin result = action.createResult(null, classifier);
result.setUpperValue(MDDUtil.createLiteralUnlimitedNatural(namespaceTracker.currentPackage(),
LiteralUnlimitedNatural.UNLIMITED));
builder.registerOutput(result);
fillDebugInfo(action, node);
} finally {
builder.closeAction();
}
checkIncomings(action, node, getBoundElement());
}
示例4: caseAVariableAccess
import org.eclipse.uml2.uml.OutputPin; //导入依赖的package包/类
@Override
public void caseAVariableAccess(AVariableAccess node) {
ReadVariableAction action = (ReadVariableAction) builder.createAction(IRepository.PACKAGE
.getReadVariableAction());
try {
super.caseAVariableAccess(node);
final OutputPin result = action.createResult(null, null);
builder.registerOutput(result);
String variableName = TextUMLCore.getSourceMiner().getIdentifier(node.getIdentifier());
Variable variable = builder.getVariable(variableName);
ensure(variable != null, node.getIdentifier(), Severity.ERROR, () -> "Unknown local variable '" + variableName + "'");
action.setVariable(variable);
TypeUtils.copyType(variable, result, getBoundElement());
fillDebugInfo(action, node);
} finally {
builder.closeAction();
}
checkIncomings(action, node.getIdentifier(), getBoundElement());
}
示例5: ActivityNodeResolver
import org.eclipse.uml2.uml.OutputPin; //导入依赖的package包/类
public ActivityNodeResolver(Map<CreateObjectAction, String> objectMap,Map<CallOperationAction, OutputPin> returnOutputsToCallActions,
OutVariableExporter tempVariableExporter, UserVariableExporter userVariableExporter) {
this.objectMap = objectMap;
this.returnOutputsToCallActions = returnOutputsToCallActions;
this.tempVariableExporter = tempVariableExporter;
this.userVariableExporter = userVariableExporter;
}
示例6: exportOutputPinToMap
import org.eclipse.uml2.uml.OutputPin; //导入依赖的package包/类
public void exportOutputPinToMap(OutputPin out) {
if (!outTempVariables.containsKey(out)) {
outTempVariables.put(out, ActivityTemplates.TempVar + tempVariableCounter);
tempVariableCounter++;
}
}
示例7: CallOperationExporter
import org.eclipse.uml2.uml.OutputPin; //导入依赖的package包/类
public CallOperationExporter(OutVariableExporter tempVariableExporter,
Map<CallOperationAction, OutputPin> returnOutputsToCallActions,
ActivityNodeResolver activityExportResolver) {
containsTimerOperator = false;
declaredTempVariables = new HashSet<String>();
this.tempVariableExporter = tempVariableExporter;
this.returnOutputsToCallActions = returnOutputsToCallActions;
this.activityExportResolver = activityExportResolver;
}
示例8: declareAllOutTempParameters
import org.eclipse.uml2.uml.OutputPin; //导入依赖的package包/类
private String declareAllOutTempParameters(EList<OutputPin> outParamaterPins) {
StringBuilder declerations = new StringBuilder("");
for (OutputPin outPin : outParamaterPins) {
declerations.append(VariableTemplates.variableDecl(outPin.getType().getName(),
tempVariableExporter.getRealVariableName(outPin), false));
}
return declerations.toString();
}
示例9: searchReturnPin
import org.eclipse.uml2.uml.OutputPin; //导入依赖的package包/类
private OutputPin searchReturnPin(EList<OutputPin> results, EList<Parameter> outputParameters) {
for (int i = 0; i < Math.min(results.size(), outputParameters.size()); i++) {
if (outputParameters.get(i).getDirection().equals(ParameterDirectionKind.RETURN_LITERAL)) {
return results.get(i);
}
}
return null;
}
示例10: resolveWildcardTypes
import org.eclipse.uml2.uml.OutputPin; //导入依赖的package包/类
/**
* In the context of an operation call, copies types from source to target
* for every target that still has a wildcard type.
*
* In the case of a target that is a signature,
*
* @param wildcardSubstitutions
* @param source
* @param target
*/
private void resolveWildcardTypes(Map<Type, Type> wildcardSubstitutions, TypedElement source, TypedElement target) {
if (wildcardSubstitutions.isEmpty())
return;
if (MDDExtensionUtils.isWildcardType(target.getType())) {
Type subbedType = wildcardSubstitutions.get(source.getType());
if (subbedType != null)
target.setType(subbedType);
} else if (MDDExtensionUtils.isSignature(target.getType())) {
List<Parameter> originalSignatureParameters = MDDExtensionUtils.getSignatureParameters(target.getType());
boolean signatureUsesWildcardTypes = false;
for (Parameter parameter : originalSignatureParameters) {
if (MDDExtensionUtils.isWildcardType(parameter.getType())) {
signatureUsesWildcardTypes = true;
break;
}
}
if (signatureUsesWildcardTypes) {
Activity closure = (Activity) ActivityUtils.resolveBehaviorReference((Action) ((OutputPin) source)
.getOwner());
Type resolvedSignature = MDDExtensionUtils.createSignature(namespaceTracker.currentNamespace(null));
for (Parameter closureParameter : closure.getOwnedParameters()) {
Parameter resolvedParameter = MDDExtensionUtils.createSignatureParameter(resolvedSignature,
closureParameter.getName(), closureParameter.getType());
resolvedParameter.setDirection(closureParameter.getDirection());
resolvedParameter.setUpper(closureParameter.getUpper());
}
target.setType(resolvedSignature);
}
}
}
示例11: caseALoopTest
import org.eclipse.uml2.uml.OutputPin; //导入依赖的package包/类
@Override
public void caseALoopTest(ALoopTest node) {
LoopNode currentLoop = (LoopNode) builder.getCurrentBlock();
builder.createBlock(IRepository.PACKAGE.getStructuredActivityNode());
try {
super.caseALoopTest(node);
currentLoop.getTests().add(builder.getCurrentBlock());
final OutputPin decider = ActivityUtils.getActionOutputs(builder.getLastRootAction()).get(0);
currentLoop.setDecider(decider);
} finally {
builder.closeBlock();
}
}
示例12: caseANewIdentifierExpression
import org.eclipse.uml2.uml.OutputPin; //导入依赖的package包/类
@Override
public void caseANewIdentifierExpression(final ANewIdentifierExpression node) {
ensureNotQuery(node);
final CreateObjectAction action = (CreateObjectAction) builder.createAction(IRepository.PACKAGE
.getCreateObjectAction());
try {
super.caseANewIdentifierExpression(node);
final OutputPin output = builder.registerOutput(action.createResult(null, null));
String qualifiedIdentifier = TextUMLCore.getSourceMiner().getQualifiedIdentifier(
node.getMinimalTypeIdentifier());
Classifier classifier = (Classifier) getRepository().findNamedElement(qualifiedIdentifier,
IRepository.PACKAGE.getClassifier(), namespaceTracker.currentPackage());
if (classifier == null) {
problemBuilder.addError("Unknown classifier '" + qualifiedIdentifier + "'",
node.getMinimalTypeIdentifier());
throw new AbortedStatementCompilationException();
}
if (classifier.isAbstract()) {
problemBuilder.addProblem(new NotAConcreteClassifier(qualifiedIdentifier),
node.getMinimalTypeIdentifier());
throw new AbortedStatementCompilationException();
}
output.setType(classifier);
action.setClassifier(classifier);
fillDebugInfo(action, node);
} finally {
builder.closeAction();
}
checkIncomings(action, node.getNew(), getBoundElement());
}
示例13: caseAParenthesisOperand
import org.eclipse.uml2.uml.OutputPin; //导入依赖的package包/类
@Override
public void caseAParenthesisOperand(AParenthesisOperand node) {
if (node.getCast() == null) {
// no casting, just process inner expression
node.getExpression().apply(this);
return;
}
StructuredActivityNode action = (StructuredActivityNode) builder
.createAction(Literals.STRUCTURED_ACTIVITY_NODE);
MDDExtensionUtils.makeCast(action);
try {
// register the target input pin (type is null)
InputPin sourcePin = (InputPin) action.createStructuredNodeInput(null, null);
builder.registerInput(sourcePin);
// process the target expression - this will connect its output pin
// to the input pin we just created
node.getExpression().apply(this);
// copy whatever multiplicity coming into the source to the source
TypeUtils.copyMultiplicity((MultiplicityElement) sourcePin.getIncomings().get(0).getSource(), sourcePin);
// register the result output pin
OutputPin destinationPin = (OutputPin) action.createStructuredNodeOutput(null, null);
new TypeSetter(sourceContext, namespaceTracker.currentNamespace(null), destinationPin).process(node
.getCast());
builder.registerOutput(destinationPin);
// copy whatever multiplicity coming into the source to the
// destination
TypeUtils.copyMultiplicity(sourcePin, destinationPin);
fillDebugInfo(action, node);
} finally {
builder.closeAction();
}
checkIncomings(action, node.getCast(), getBoundElement());
}
示例14: createClauseTest
import org.eclipse.uml2.uml.OutputPin; //导入依赖的package包/类
private void createClauseTest(Clause clause, PRootExpression node) {
builder.createBlock(IRepository.PACKAGE.getStructuredActivityNode());
try {
node.apply(this);
clause.getTests().add(builder.getCurrentBlock());
final OutputPin decider = ActivityUtils.getActionOutputs(builder.getLastRootAction()).get(0);
clause.setDecider(decider);
} finally {
builder.closeBlock();
}
}
示例15: isTerminal
import org.eclipse.uml2.uml.OutputPin; //导入依赖的package包/类
public static boolean isTerminal(Action instance) {
List<OutputPin> outputPins = getActionOutputs(instance);
for (OutputPin current : outputPins)
if (!current.getOutgoings().isEmpty())
return false;
return true;
}