Java Code Examples for org.eclipse.emf.ecore.util.EcoreUtil.getAllProperContents()

The following are Jave code examples for showing how to use getAllProperContents() of the org.eclipse.emf.ecore.util.EcoreUtil class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: n4js   File:   Source Code and License Vote up 6 votes
protected void buildMap(Resource resource, Map<QualifiedName, IEObjectDescription> elements) {
	IDefaultResourceDescriptionStrategy strategy = ((XtextResource) resource).getResourceServiceProvider()
	TreeIterator<EObject> allProperContents = EcoreUtil.getAllProperContents(resource, false);
	IAcceptor<IEObjectDescription> acceptor = new IAcceptor<IEObjectDescription>() {
		public void accept(IEObjectDescription description) {
			elements.put(description.getQualifiedName(), description);
	while (allProperContents.hasNext()) {
		EObject content =;
		if (!strategy.createEObjectDescriptions(content, acceptor)) {
Example 2
Project: rest-modeling-framework   File:   Source Code and License Vote up 5 votes
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 =;
        final String uriFragment = uriFragmentBuilder.getURIFragment(eObject);
        idToEObject.put(uriFragment, eObject);
    merge(apiExtension, api, idToEObject);