本文整理匯總了Java中org.eclipse.emf.ecore.util.EcoreUtil.getAllProperContents方法的典型用法代碼示例。如果您正苦於以下問題:Java EcoreUtil.getAllProperContents方法的具體用法?Java EcoreUtil.getAllProperContents怎麽用?Java EcoreUtil.getAllProperContents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.emf.ecore.util.EcoreUtil
的用法示例。
在下文中一共展示了EcoreUtil.getAllProperContents方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: buildMap
import org.eclipse.emf.ecore.util.EcoreUtil; //導入方法依賴的package包/類
@Override
protected void buildMap(Resource resource, Map<QualifiedName, IEObjectDescription> elements) {
IDefaultResourceDescriptionStrategy strategy = ((XtextResource) resource).getResourceServiceProvider()
.get(IDefaultResourceDescriptionStrategy.class);
TreeIterator<EObject> allProperContents = EcoreUtil.getAllProperContents(resource, false);
IAcceptor<IEObjectDescription> acceptor = new IAcceptor<IEObjectDescription>() {
@Override
public void accept(IEObjectDescription description) {
elements.put(description.getQualifiedName(), description);
}
};
while (allProperContents.hasNext()) {
EObject content = allProperContents.next();
if (!strategy.createEObjectDescriptions(content, acceptor)) {
allProperContents.prune();
}
}
}
示例2: merge
import org.eclipse.emf.ecore.util.EcoreUtil; //導入方法依賴的package包/類
private void merge(final ApiExtension apiExtension, final Api api) {
final TreeIterator<EObject> allProperContents = EcoreUtil.getAllProperContents(api, false);
final Map<String, EObject> idToEObject = new HashMap<>();
while (allProperContents.hasNext()) {
final EObject eObject = allProperContents.next();
final String uriFragment = uriFragmentBuilder.getURIFragment(eObject);
idToEObject.put(uriFragment, eObject);
}
merge(apiExtension, api, idToEObject);
}