本文整理了Java中org.eclipse.uml2.uml.Operation.getDatatype()
方法的一些代码示例,展示了Operation.getDatatype()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Operation.getDatatype()
方法的具体详情如下:
包路径:org.eclipse.uml2.uml.Operation
类名称:Operation
方法名:getDatatype
[英]Returns the value of the 'Datatype' container reference. It is bidirectional and its opposite is ' org.eclipse.uml2.uml.DataType#getOwnedOperations'.
This feature subsets the following features:
The DataType that owns this Operation.
[中]返回“Datatype”容器引用的值。它是双向的,它的对立面是“组织”。日食uml2。uml。数据类型#getOwnedOperations”。
此功能是以下功能的子集:
*“组织。日食uml2。uml。RedefinableElement#getRedefinitionContexts()'
*“组织。日食uml2。uml。NamedElement#getNamespace()'
*“组织。日食uml2。uml。功能#GetFeatureingClassifiers()'
拥有此操作的数据类型。
代码示例来源:origin: org.andromda.metafacades/andromda-metafacades-emf-uml22
/**
* @see org.andromda.metafacades.uml.OperationFacade#getOwner()
*/
@Override
protected Object handleGetOwner()
{
Object obj = null;
// Fix from UML2, no longer calls getOwner to get the owning Class
if (this.metaObject.getInterface()!=null)
{
obj = this.metaObject.getInterface();
}
else if (this.metaObject.getDatatype()!=null)
{
obj = this.metaObject.getDatatype();
}
else
{
obj = this.metaObject.getClass_();
}
return obj;
}
代码示例来源:origin: org.andromda.bootstrap.metafacades/andromda-metafacades-emf-uml22
/**
* @see org.andromda.metafacades.uml.OperationFacade#getOwner()
*/
@Override
protected Object handleGetOwner()
{
Object obj = null;
// Fix from UML2, no longer calls getOwner to get the owning Class
if (this.metaObject.getInterface()!=null)
{
obj = this.metaObject.getInterface();
}
else if (this.metaObject.getDatatype()!=null)
{
obj = this.metaObject.getDatatype();
}
else
{
obj = this.metaObject.getClass_();
}
return obj;
}
代码示例来源:origin: org.umlg/java-generation-ocl
@Override
public String handleOperationExp(OperationCallExp<Classifier, Operation> oc, String sourceResult, List<String> argumentResults) {
if (argumentResults.size() != 1) {
throw new IllegalStateException("The greater than equal operation must have one and only one argument!");
}
StringBuilder result = new StringBuilder();
result.append(sourceResult);
DataType datatype = oc.getReferredOperation().getDatatype();
if (datatype instanceof PrimitiveType) {
PrimitiveType primitiveType = (PrimitiveType) datatype;
if (primitiveType.getName().equals("Integer") || primitiveType.getName().equals("Real")) {
result.append(" >= ");
result.append(argumentResults.get(0));
} else {
throw new IllegalStateException("Greater than equal operation can only be called on a PrimitiveType Integer and Real " + datatype.getName());
}
} else {
throw new IllegalStateException("Greater than equal operation can only be called on a PrimitiveType " + datatype.getName());
}
return result.toString();
}
}
代码示例来源:origin: org.umlg/java-generation-ocl
@Override
public String handleOperationExp(OperationCallExp<Classifier, Operation> oc, String sourceResult, List<String> argumentResults) {
if (argumentResults.size() != 1) {
throw new IllegalStateException("The greater than operation must have one and only one argument!");
}
StringBuilder result = new StringBuilder();
result.append(sourceResult);
DataType datatype = oc.getReferredOperation().getDatatype();
if (datatype instanceof PrimitiveType) {
PrimitiveType primitiveType = (PrimitiveType) datatype;
if (primitiveType.getName().equals("Integer") || primitiveType.getName().equals("Real")) {
result.append(" > ");
result.append(argumentResults.get(0));
} else {
throw new IllegalStateException("Greater than operation can only be called on a PrimitiveType Integer and Real " + datatype.getName());
}
} else {
throw new IllegalStateException("Greater than operation can only be called on a PrimitiveType " + datatype.getName());
}
return result.toString();
}
}
代码示例来源:origin: org.umlg/java-generation-ocl
@Override
public String handleOperationExp(OperationCallExp<Classifier, Operation> oc, String sourceResult, List<String> argumentResults) {
if (argumentResults.size() != 1) {
throw new IllegalStateException("The less than operation must have one and only one argument!");
}
StringBuilder result = new StringBuilder();
result.append(sourceResult);
DataType datatype = oc.getReferredOperation().getDatatype();
if (datatype instanceof PrimitiveType) {
PrimitiveType primitiveType = (PrimitiveType) datatype;
if (primitiveType.getName().equals("Integer") || primitiveType.getName().equals("Real")) {
result.append(" < ");
result.append(argumentResults.get(0));
} else {
throw new IllegalStateException("Less than operation can only be called on a PrimitiveType Integer and Real " + datatype.getName());
}
} else {
throw new IllegalStateException("Less than can operation only be called on a PrimitiveType " + datatype.getName());
}
return result.toString();
}
}
代码示例来源:origin: org.umlg/java-generation-ocl
@Override
public String handleOperationExp(OperationCallExp<Classifier, Operation> oc, String sourceResult, List<String> argumentResults) {
if (argumentResults.size() != 1) {
throw new IllegalStateException("The less equal than operation must have one and only one argument!");
}
StringBuilder result = new StringBuilder();
result.append(sourceResult);
DataType datatype = oc.getReferredOperation().getDatatype();
if (datatype instanceof PrimitiveType) {
PrimitiveType primitiveType = (PrimitiveType) datatype;
if (primitiveType.getName().equals("Integer") || primitiveType.getName().equals("Real")) {
result.append(" <= ");
result.append(argumentResults.get(0));
} else {
throw new IllegalStateException("Less than equal operation can only be called on a PrimitiveType Integer and Real " + datatype.getName());
}
} else {
throw new IllegalStateException("Less than equal operation can only be called on a PrimitiveType " + datatype.getName());
}
return result.toString();
}
}
代码示例来源:origin: org.umlg/java-generation-ocl
DataType datatype = oc.getReferredOperation().getDatatype();
String argResult = argumentResults.get(0);
if (datatype instanceof PrimitiveType) {
代码示例来源:origin: org.umlg/java-generation-ocl
DataType datatype = oc.getReferredOperation().getDatatype();
if (datatype instanceof PrimitiveType) {
PrimitiveType primitiveType = (PrimitiveType) datatype;
代码示例来源:origin: org.umlg/java-generation-util
if (oper.getClass_() != null) {
sb.append(oper.getClass_().getName());
} else if (oper.getDatatype() != null) {
sb.append(oper.getDatatype().getName());
} else {
throw new IllegalStateException("Operation only supported on Class and Datatype");
内容来源于网络,如有侵权,请联系作者删除!