本文整理匯總了Java中org.eclipse.emf.ecore.EReference.isDerived方法的典型用法代碼示例。如果您正苦於以下問題:Java EReference.isDerived方法的具體用法?Java EReference.isDerived怎麽用?Java EReference.isDerived使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.emf.ecore.EReference
的用法示例。
在下文中一共展示了EReference.isDerived方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getConnectedEdgesForEObject
import org.eclipse.emf.ecore.EReference; //導入方法依賴的package包/類
/**
* Add outgoing references
*/
private void getConnectedEdgesForEObject(Node node, final List<Node> allNodes, final List<Edge> result,
final EObject eobj) {
for (EReference currRef : eobj.eClass().getEAllReferences()) {
if (!currRef.isDerived() && !currRef.isContainer()) {
if (currRef.isMany()) {
final Object targets = eobj.eGet(currRef, false);
if (targets instanceof Collection<?>) {
getConnectedEdgesForEObjectManyCase(node, allNodes, result, currRef, targets);
}
} else {
final Object target = eobj.eGet(currRef, false);
if (target instanceof EObject) {
getConnectedEdgesForEObjectSingleCase(node, allNodes, result, currRef, target);
}
}
}
}
// add reference to containing Resource if immediate container is not in graph
// (required when showing lower-level objects while hiding their ancestors)
Node nodeForElement = GraphUtils.getNodeForElement(eobj.eContainer(), allNodes);
if (eobj.eResource() != null && eobj.eContainer() != null && nodeForElement == null) {
final Node nodeForResource = GraphUtils.getNodeForElement(eobj.eResource(), allNodes);
if (nodeForResource != null) {
Edge edge = new Edge(
"<... containment omitted ...>",
false, // not a cross-link
nodeForResource,
Collections.singletonList(node),
Collections.emptyList());
result.add(edge);
}
}
}