本文整理汇总了Java中org.eclipse.uml2.uml.ParameterDirectionKind.RETURN_LITERAL属性的典型用法代码示例。如果您正苦于以下问题:Java ParameterDirectionKind.RETURN_LITERAL属性的具体用法?Java ParameterDirectionKind.RETURN_LITERAL怎么用?Java ParameterDirectionKind.RETURN_LITERAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.uml2.uml.ParameterDirectionKind
的用法示例。
在下文中一共展示了ParameterDirectionKind.RETURN_LITERAL属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MemberOperation
/**
* Creates a MemberOperation based on the EMF-UML model-element provided
*
* @param op
* the EMF-UML model-element which holds informations of this
* diagram element
*/
public MemberOperation(Operation op) {
super(op.getName(), op.getVisibility());
isAbstract = op.isAbstract();
isStatic = op.isStatic();
returnType = null;
args = new ArrayList<Argument>();
for (Parameter arg : op.getOwnedParameters()) {
// return type is a parameter in the EMF-UML model
if (arg.getDirection() == ParameterDirectionKind.RETURN_LITERAL) {
returnType = arg.getType().getName();
} else {
args.add(new Argument(arg));
}
}
}
示例2: getNonReturnParameters
/**
* Creates a list of non-return (in, out, and in-out) parameters of an
* operation.
*
* @param op
* The specified operation
* @return List of non-return parameters.
*/
private static List getNonReturnParameters(Operation op) {
ArrayList plist = new ArrayList();
Iterator iter = op.getOwnedParameters().iterator();
while (iter.hasNext()) {
Parameter p = (Parameter) iter.next();
if (p.getDirection() != ParameterDirectionKind.RETURN_LITERAL) {
plist.add(p);
}
}
return plist;
}
示例3: getEParameters
@Override
public EList<EParameter> getEParameters() {
List<Parameter> paramList = origOperation.getOwnedParameters();
EList<EParameter> result = new BasicEList<EParameter>();
if (! paramList.isEmpty()){
for (Parameter param : paramList)
if (param.getDirection() != ParameterDirectionKind.RETURN_LITERAL)
result.add(((EResourceUMLAdapter)owningResource).getParamIfNotExists(new EParameterUMLAdapter(param,owningResource)));
}
return result;
}
示例4: createParameter
protected Parameter createParameter(String name, PTypeIdentifier typeNode, ParameterDirectionKind direction) {
if (name == null && direction != ParameterDirectionKind.RETURN_LITERAL && !unnamedParameters) {
problemBuilder.addError("Parameter names are required in this context", typeNode.parent());
return null;
}
Parameter parameter = createParameter(name);
parameter.setDirection(direction);
createParameterTypeSetter(parameter).process(typeNode);
// a default value was provided, consider this not required
if (parameter.getDefault() != null || parameter.getDefaultValue() != null)
parameter.setLowerValue(MDDUtil.createLiteralUnlimitedNatural(parent.getNearestPackage(), 0));
return parameter;
}
示例5: createParameterVariables
public static void createParameterVariables(Activity activity) {
StructuredActivityNode bodyNode = getBodyNode(activity);
for (Parameter parameter : activity.getOwnedParameters()) {
// variables represent the value for each input/output parameter -
// their values will be transferred to the output pins of the
// activity at the end
// convention: the unnamed variable corresponds to the result value
String varName = parameter.getDirection() == ParameterDirectionKind.RETURN_LITERAL ? "" : parameter
.getName();
Variable newVariable = bodyNode.createVariable(varName, null);
TypeUtils.copyType(parameter, newVariable);
}
}
示例6: handleBinaryExpressionAsOperation
public void handleBinaryExpressionAsOperation(Node contextNode, Supplier<Node> operand1, Supplier<Node> operand2, String operationName) {
CallOperationAction action = (CallOperationAction) builder.createAction(IRepository.PACKAGE
.getCallOperationAction());
try {
// register the target input pin
builder.registerInput(action.createTarget(null, null));
// register the argument input pins
builder.registerInput(action.createArgument(null, null));
// process the target and argument expressions - this will connect
// their output pins to the input pins we just created
Node targetNode = operand1.get();
Node argumentNode = operand2.get();
InputPin target = action.getTarget();
InputPin argument = action.getArguments().get(0);
Type targetType = ActivityUtils.getSource(target).getType();
Type argumentType = ActivityUtils.getSource(argument).getType();
ensure(targetType != null, targetNode, () -> new UnclassifiedProblem("No type information for " + operand1));
ensure(argumentType != null, argumentNode, () -> new UnclassifiedProblem("No type information for " + operand2));
TypeUtils.copyType(ActivityUtils.getSource(target), target);
TypeUtils.copyType(ActivityUtils.getSource(argument), argument);
List<TypedElement> argumentList = Collections.singletonList((TypedElement) argument);
Operation operation = FeatureUtils.findOperation(getRepository(), (Classifier) targetType, operationName,
argumentList, false, true);
if (operation == null)
missingOperation(true, contextNode, (Classifier) targetType, operationName,
argumentList, false);
if (operation.isStatic())
missingOperation(true, contextNode, (Classifier) targetType, operationName, argumentList,
false);
List<Parameter> parameters = operation.getOwnedParameters();
if (parameters.size() != 2 && parameters.get(0).getDirection() != ParameterDirectionKind.IN_LITERAL
&& parameters.get(1).getDirection() != ParameterDirectionKind.RETURN_LITERAL) {
problemBuilder.addError("Unexpected signature: '" + operationName + "' in '"
+ target.getType().getQualifiedName() + "'", contextNode);
throw new AbortedStatementCompilationException();
}
// register the result output pin
builder.registerOutput(action.createResult(null, operation.getType()));
action.setOperation(operation);
fillDebugInfo(action, contextNode.parent());
} finally {
builder.closeAction();
}
checkIncomings(action, contextNode, getBoundElement());
}