本文整理汇总了Java中org.eclipse.uml2.uml.Classifier.getOperations方法的典型用法代码示例。如果您正苦于以下问题:Java Classifier.getOperations方法的具体用法?Java Classifier.getOperations怎么用?Java Classifier.getOperations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.uml2.uml.Classifier
的用法示例。
在下文中一共展示了Classifier.getOperations方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ClassNode
import org.eclipse.uml2.uml.Classifier; //导入方法依赖的package包/类
/**
* Creates a ClassNode based on the EMF-UML model-element and layout
* information provided
*
*
* @param clazz
* the EMF-UML model-element which holds informations of this
* diagram element
* @param id
* the layout id of this element
*/
public ClassNode(Classifier clazz, String id) {
/*
* position = layout.getPosition(); width = layout.getWidth(); height =
* layout.getHeight(); id = layout.getName();
*/
this.id = id;
name = clazz.getName();
attributes = new ArrayList<Attribute>();
// creating attributes
for (Property attr : clazz.getAttributes()) {
if (attr.getAssociation() == null) {
attributes.add(new Attribute(attr));
}
}
operations = new ArrayList<MemberOperation>();
// creating operations
for (Operation op : clazz.getOperations()) {
operations.add(new MemberOperation(op));
}
if (clazz.isAbstract()) {
type = CDNodeType.ABSTRACT_CLASS;
} else {
type = CDNodeType.CLASS;
}
}
示例2: getEntryPointOperation
import org.eclipse.uml2.uml.Classifier; //导入方法依赖的package包/类
public Operation getEntryPointOperation(Package package_) {
for (NamedElement element : package_.getOwnedMembers()) {
if (!(element instanceof Classifier))
continue;
Classifier classifier = (Classifier) element;
for (Operation operation : classifier.getOperations())
if (MDDExtensionUtils.isEntryPoint(operation))
return operation;
}
return null;
}
示例3: getBehavioralFeatures
import org.eclipse.uml2.uml.Classifier; //导入方法依赖的package包/类
public static List<? extends BehavioralFeature> getBehavioralFeatures(Classifier classifier) {
if (!(classifier instanceof Interface) && !(classifier instanceof Class))
return classifier.getOperations();
List<BehavioralFeature> combined = new ArrayList<>(classifier.getOperations());
EList<Reception> receptions = (classifier instanceof Interface) ? ((Interface) classifier).getOwnedReceptions()
: ((Class) classifier).getOwnedReceptions();
combined.addAll(receptions);
return combined;
}
示例4: findOperation
import org.eclipse.uml2.uml.Classifier; //导入方法依赖的package包/类
/**
* Finds an operation in the given classifier.
*
* @param arguments
* the arguments to match, or null for name-based matching only
*/
public static Operation findOperation(IRepository repository, Classifier classifier, String operationName,
List<TypedElement> arguments, ParameterSubstitutionMap substitutions, boolean ignoreCase, boolean recurse) {
for (Operation operation : classifier.getOperations()) {
if (isNameMatch(operation, operationName, ignoreCase)
&& (isMatch(repository, operation, arguments, substitutions)))
return operation;
}
if (!recurse)
return null;
Operation found;
final EList<TemplateBinding> templateBindings = classifier.getTemplateBindings();
if (!templateBindings.isEmpty())
for (TemplateBinding templateBinding : templateBindings) {
TemplateSignature signature = templateBinding.getSignature();
ParameterSubstitutionMap newSubstitutions = new ParameterSubstitutionMap(templateBinding);
found = findOperation(repository, (Classifier) signature.getTemplate(), operationName, arguments,
newSubstitutions, ignoreCase, true);
if (found != null)
return found;
}
for (Generalization generalization : classifier.getGeneralizations())
if ((found = findOperation(repository, generalization.getGeneral(), operationName, arguments,
substitutions, ignoreCase, true)) != null)
return found;
// recurse to owning classifier
for (Namespace owner = (Namespace) classifier.getOwner(); owner instanceof Classifier; owner = (Namespace) owner
.getOwner())
if ((found = findOperation(repository, (Classifier) owner, operationName, arguments, substitutions,
ignoreCase, true)) != null)
return found;
// fallback to interfaces realized
if (classifier instanceof BehavioredClassifier) {
BehavioredClassifier asBehaviored = (BehavioredClassifier) classifier;
for (Interface implemented : asBehaviored.getImplementedInterfaces())
if ((found = findOperation(repository, implemented, operationName, arguments, substitutions,
ignoreCase, true)) != null)
return found;
}
return null;
}